Jump to content

HELP: LISP/Macro script to bring specific layer by name to the front


vernonlee

Recommended Posts

I have a specific layer name that I constantly need to have it "bring to front" in terms of draw order.

 

Can someone help me with a LISP/Macro script that do just that?

 

Thanks

Link to comment
Share on other sites

Please refer to this thread.

 

http://www.cadtutor.net/forum/showthread.php?26055-Lisp-for-Automatic-Draw-Order-Command-to-a-specific-Layer.&highlight=draw+order%2C+dimension

 

All you would have to do is rename the layer and change the setting to "front"

 

This particular LISP from Lee Mac did the trick. :shock:

 

However the wildcard layer name do not seems to include xref layers. :ouch:

 

I also include it as a specific layer name as such : "xref dwg name|Layer name". But no go.

 

Any advise to include xref layers?

 

(defun c:OrderLay ( / laylist ss )

 (setq laylist '("LAYER1"  ;  <---<< List Layers Here.
                 "LAYER2"
                 "LAYER3"
 ))

 (foreach lay laylist
   (if (setq ss (ssget "_X" (list (cons 8 lay))))
     (command "_.draworder" ss "" "_F")
   )
 )

 (princ)
)

Edited by vernonlee
Link to comment
Share on other sites

Briefly saw it. But it cannot reorder by layer name only right? The layer still have to be selected, am i correct?

 

Note that the programs listed on the main function page are only examples - you can design any custom program to call the draw order functions, including one that will prompt for a layer name.

 

Alternatively, there is my Layer Draw Order program.

Link to comment
Share on other sites

However the wildcard layer name do not seems to include xref layers. :ouch:

 

I also include it as a specific layer name as such : "xref dwg name|Layer name". But no go.

 

Since the standard AutoCAD DRAWORDER command operates with a set of objects as opposed to layer names, the supplied objects must be primary objects as AutoCAD commands which accept a selection set cannot work with nested objects.

 

Whereas, my Draw Order functions (as suggested above) will operate with objects derived from any owner (that is, primary objects in any layout, or objects contained within a block definition [an xref is merely a special type of block]).

Link to comment
Share on other sites

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...