Sam Jones Posted October 15, 2022 Share Posted October 15, 2022 (edited) I want to get a handle to the group created by the command SymbolToGroup(). LNewObj is not successful in delivering the result. {==========================================================} PROCEDURE Sym2GrpTest; {$DEBUG} CONST kSymName = 'Light Instr ETC Source 4 19deg 750W'; VAR TheSym :HANDLE; TheGrp :HANDLE; BEGIN Symbol(kSymName, 12, 12, 0); TheSym := LNewObj; SymbolToGroup(TheSym, 1); TheGrp := LNewObj; {TheGrp always receives the value of NIL} IF TheGrp <> NIL THEN BEGIN Scale(0.5, 0.5); SetName(TheGrp, 'The New Group'); END ELSE AlrtDialog('The Grp is NIL'); END; RUN(Sym2GrpTest); {==========================================================} Substituting "TheGrp := FSActLayer;" for "TheGrp := LNewObj;" is successful, but only if only one object is selected. When one tries to poll through an array of handles and placing them one at a time. FSActLayer does not change value. So, does anyone know how to get a handle to the result of the "SymbolToGroup(TheSym, 1);" command? Edited October 15, 2022 by Sam Jones grammar Quote Link to comment
MullinRJ Posted October 15, 2022 Share Posted October 15, 2022 @Sam Jones, Use LActLayer, or a Waldo that places a locus and retrieves the PrevObj(LNewObj), were LNewObj is now the Locus. Delete when done. Raymond 1 Quote Link to comment
Vectorworks, Inc Employee Julian_Carr Posted October 15, 2022 Vectorworks, Inc Employee Share Posted October 15, 2022 Yep that's what I do: SymbolToGroup(h1, 4); Locus(0, 0); h1 := LNewObj; hGroup := PrevObj(h1); DelObject(h1); 3 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.