Kristen Posted December 4, 2002 Share Posted December 4, 2002 Could someone give me some tips on how to do a script which would send all objects on certain classes to the front? Could a script do this on all layers (I guess by setting them to show/snap/modify, and then turning layers back to active only after finishing)? Quote Link to comment
Fuge Posted December 5, 2002 Share Posted December 5, 2002 If I understand you correctly you can move all objects attached to a particular class to the front on any or all layers. Basically your script would have to: 1. Go to the first layer in your document. 2, Select all object attached to the class to process, maybe use DSelectAll; SelectObj((C='theclassname')); 3. Cycle through each selected object and use HMoveForward(); to move everything forward. 4. Deselect everything on the layer. 5. Go to the next layer and repeat the process until all layers are done. You wouldn't have to toggle layer visibility or anything like that, just go to each layer and process the objects. Writing this script wouldn't be too hard. HTH Dave Quote Link to comment
matto Posted December 5, 2002 Share Posted December 5, 2002 yep would have to do each layer at a time. 1.then you can make a handle to all the objects in a class. 2. look at the ForEachObjectInList function should make it fairly easy. thou be careful which order you process the list. if you do the front object first it will end up at the back of the objects on that class. do from back to front and should do what you want. or crazy as it sounds and by far not the best way. go thought each layer and select and group objects then ungroup. standard VW behaviour if you group objects is the bring them to front of everything else but in the same order as before. watch out it may also move them onto the active layer. Quote Link to comment
Alexandre Villares Posted December 7, 2002 Share Posted December 7, 2002 4AM here, I couldn't help give the problem a try... How about: {NOT TESTED!} PROCEDURE UpClass; FUNCTION UpHnd(h:HANDLE):BOOLEAN; BEGIN IF GetClass(h)='class-to-be-sent-up' THEN HMoveForward (h, TRUE ) ; END; BEGIN ForEachObjectInLayer(UpHnd,4,1,1); END; Run(UpClass); ---------- PROCEDURE ??ForEachObjectInLayer ( ? actionFunc :PROCEDURE; ? ? objOptions :INTEGER; ? ? travOptions :INTEGER; ? ? layerOptions :INTEGER ) ; Object Options All objects 0 Visible Objects only 1 Selected Objects only 2 Unlocked objects only 4 Traversal Options Traverse Shallow 0 Traverse Groups 1 Traverse Deep 2 Layer Options Current layer 0 All layers 1 Visible layers 2 Editable layers 4 Snappable layers 8 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.