Jump to content
Sign in to follow this  
Kristen

sending class to front

Recommended Posts

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)?

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

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

Share this post


Link to post

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...