VS:SymbolToGroup: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
(add remark: difficult list position) |
||
Line 52: | Line 52: | ||
</lineList> | </lineList> | ||
</params> | </params> | ||
----------------------------------------------------------------------------------------------------------- | |||
<remark> | |||
([[User:Orso.b.schmid|Orso]], 2014.09.14): Upon success, this creates a group which doesn't respond to ''LNewObj''. It actually disables ''LNewObj'', which will return NIL, unregarded what you created before running ''SymbolToGroup'' | |||
The handle to the group can be fetched storing a handle to the object BEFORE the symbol on drawing, then fetching the object afterwards: | |||
<code lang="pas"> | |||
PROCEDURE T; | |||
VAR | |||
h : HANDLE; | |||
BEGIN | |||
h := PrevObj(FSActLayer); { store "h" as placeholder } | |||
{ FSActLayer is a symbol on drawing } | |||
IF FSActLayer <> NIL THEN BEGIN | |||
SymbolToGroup(FSActLayer, 2); | |||
Message(GetType(NextObj(h))); | |||
END ELSE | |||
AlrtDialog('Select a symbol on drawing!'); | |||
END; | |||
RUN(T);</code> | |||
</remark> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
Revision as of 15:21, 14 September 2014
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Converts referenced symbol to group using the specified conversion options.
Convert Action | Constant |
---|---|
Don't convert subobjects | 0 |
Convert plug-in and symbol subobjects | 1 |
Convert all subobjects | 2 |
PROCEDURE SymbolToGroup(
h :HANDLE;
convertAction :INTEGER);
def vs.SymbolToGroup(h, convertAction): return None
Parameters
h HANDLE Handle to the symbol convertAction INTEGER Conversion action:
Remarks
(Orso, 2014.09.14): Upon success, this creates a group which doesn't respond to LNewObj. It actually disables LNewObj, which will return NIL, unregarded what you created before running SymbolToGroup
The handle to the group can be fetched storing a handle to the object BEFORE the symbol on drawing, then fetching the object afterwards:
PROCEDURE T; VAR h : HANDLE; BEGIN h := PrevObj(FSActLayer); { store "h" as placeholder } { FSActLayer is a symbol on drawing } IF FSActLayer <> NIL THEN BEGIN SymbolToGroup(FSActLayer, 2); Message(GetType(NextObj(h))); END ELSE AlrtDialog('Select a symbol on drawing!'); END; RUN(T);
Version
Availability: from VectorWorks 10.0