VS:SymbolToGroup: Difference between revisions
Jump to navigation
Jump to search
(expand example) |
m (Transfer Orso to _c_) |
||
(One intermediate revision by the same user not shown) | |||
Line 55: | Line 55: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark> | <remark> | ||
([[User: | ([[User:CBM-c-|_c_]], 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 | The handle to the group can be fetched storing a handle to the object BEFORE the symbol on drawing, then fetching the next object: | ||
<code lang="pas"> | <code lang="pas"> | ||
PROCEDURE | PROCEDURE Test; | ||
VAR | VAR | ||
h : HANDLE; | h : HANDLE; | ||
BEGIN | BEGIN | ||
h := PrevObj(FSActLayer); { store "h" as placeholder } | h := PrevObj(FSActLayer); { store "h" as placeholder } | ||
IF FSActLayer <> NIL THEN BEGIN | { FSActLayer must be a symbol on drawing } | ||
IF (FSActLayer <> NIL) & (GetType(h) = 15) THEN BEGIN | |||
SymbolToGroup(FSActLayer, 2); | SymbolToGroup(FSActLayer, 2); | ||
{ fetch group starting from placeholder "h" } | { fetch group starting from placeholder "h" } | ||
Message(GetType(NextObj(h))); { <-- NextObj(h) should return 11: is the new group } | |||
END ELSE | END ELSE | ||
AlrtDialog('Select a symbol on drawing!'); | AlrtDialog('Select a symbol on drawing!'); | ||
END; | END; | ||
RUN( | RUN(Test);</code> | ||
</remark> | </remark> | ||
Latest revision as of 05:45, 30 December 2020
.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
(_c_, 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 next object:
PROCEDURE Test; VAR h : HANDLE; BEGIN h := PrevObj(FSActLayer); { store "h" as placeholder } { FSActLayer must be a symbol on drawing } IF (FSActLayer <> NIL) & (GetType(h) = 15) THEN BEGIN SymbolToGroup(FSActLayer, 2); { fetch group starting from placeholder "h" } Message(GetType(NextObj(h))); { <-- NextObj(h) should return 11: is the new group } END ELSE AlrtDialog('Select a symbol on drawing!'); END; RUN(Test);
Version
Availability: from VectorWorks 10.0