MarcelP102 Posted July 23, 2022 Share Posted July 23, 2022 Hi all, I've build a script that uses CallTool(-203) to draw a square and use that as a LOC criteria to isolate or hide objects. To get the handle of the newly created object within a symbol I had to use NextObj (dummyH) as was advised here. So far everything works. Except when using the tool on objects that are within a group within a symbol. Then the LOC criteria doesn't seem to work. Do you have any tips? See attachment for VW file with scripts and object, or use the code below box selectie.vwx Code for IsolateBoxSelection: PROCEDURE IsolateBoxSelection; VAR H1, dummyH :HANDLE; BEGIN Locus(0,0); dummyH := LNewObj; CallTool(-203); h1 := NextObj (dummyH); SetName(h1, 'MySelectionPolygon'); DSelectAll; SelectObj(INSYMBOL & (LOC='MySelectionPolygon')); Hide(INSYMBOL & (SEL=False)); DSelectAll; DelObject(h1); DelObject(dummyH); ReDrawAll; END; Run(IsolateBoxSelection); Code for HideBoxSelection: PROCEDURE HideBoxSelection; VAR H1, dummyH :HANDLE; BEGIN Locus(0,0); dummyH := LNewObj; CallTool(-203); h1 := NextObj (dummyH); SetName(h1, 'MySelectionPolygon'); DSelectAll; Hide(INSYMBOL & (LOC='MySelectionPolygon')); DelObject(h1); DelObject(dummyH); END; Run(HideBoxSelection); Quote Link to comment
Vectorworks, Inc Employee Julian_Carr Posted July 23, 2022 Vectorworks, Inc Employee Share Posted July 23, 2022 LOC doesn't work in symbol definitions so you might need to get the centre of each object in the symbol then check it is within the LOC rectangle using PtInRect(). 1 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.