Jump to content

sending class to front


Kristen

Recommended Posts

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

Link to comment

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.

Link to comment

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

Link to comment

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.

×
×
  • Create New...