twk Posted June 11, 2014 Share Posted June 11, 2014 Hello peoples.. I'm trying to run a script while inside a VP annotation, it's baffling me, as to why by using foreachobject(and using sel=true for criteria) or by using foreachobjectinlist(using a number of combinations for the obj/trav options, i still can't get a handle to the selected objects inside the VP.. below is my code PROCEDURE RandomRotate; VAR VPhnd, h2ViewPortGroup : HANDLE; {$DEBUG} FUNCTION RandRot(h:HANDLE):BOOLEAN; VAR px, py : REAL; BEGIN IF GetTypeN(h) = 15 THEN BEGIN GetSymLoc(h, px, py); HRotate(h, px, py, Random*90); END; END; BEGIN DSelectAll; VPhnd := FSActLayer; h2ViewPortGroup := GetVPGroup(VPhnd, 2); {ForEachObject(RandRot, SEL=TRUE);} ForEachObjectinList(RandRot, 2, 1, h2ViewPortGroup); END; RUN(RandomRotate); Quote Link to comment
Pat Stanford Posted June 12, 2014 Share Posted June 12, 2014 Check your options for ForEachObjectInList. The 2,1 you are using tells it to only operate on selected objects and to recurse into groups. At the beginning of the script you DSelectAll so nothing is selected. Try 0,1 for the options and you should get what you are looking for. Quote Link to comment
twk Posted June 12, 2014 Author Share Posted June 12, 2014 Thanks Pat, that did the trick, much appreciated. 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.