AutoCAD/Brong layer to front

Advertisement


Question
Hello



I know there is the 'bring to front', 'send to back' and 'bring above objects' and 'send under objects' tools to our rescue.

But in my case I have about 10 layers ovelapping with about 100,000 blocks contained in them. Using the above options asks me to select objects which is touhg when all layers are ON. if I switch OFF everything else and let only that layer ON I cant select ref objects.  Now what do I do if I want to bring en entire layer with all its contents to the forefront such that other layers stay behind it?



Is there any way wherein I could specify the order of layers e.g. layer 7  - topmost, layer 3 -2nd, layer 9 - 3rd etc....



I tried using 'DRAWORDERCTL' but didnt get much success.



please help me sort this out.

Answer
H.B.:

You can select an entire layer by using QSELECT.  After doing that, you can just type in a "P" for previous selection to select the whole layer's objects.

You can also use QSELECT to select block names, or refine your search to select block names placed on certain layers.  There are a lot of options and different kinds of selections one can perform with QSELECT.

Here is a lisp routine I wrote to pick your layer draw order by picking objects:

(defun c:dola (/ sset ssqty ent index)
  (prompt "\nPick objects in desired order:  ")
  (setq sset (ssget))
  (setq ssqty (sslength sset))
  (setq index 0)
  (repeat ssqty
     (setq ent (ssname sset index))
     (if (> index 0)
        (progn
           (setq elist  (entget ent))
           (setq layr (cdr (assoc 8 elist)))
           (setq layrdb (ssget "x" (list (cons 8 layr))))
           (command "_.draworder" layrdb "" "f")
        )
     )
     (setq index (1+ index))
  )
  (princ)
)

Save the code to a text file and name it DOLA.LSP, then load with APPLOAD and then type DOLA to start the routine.

Keep in touch
Bill DeShawn

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Bill DeShawn

Expertise

I can address all 2-D questions and some 3-D questions. I do programming in AutoLISP if it doesn`t involve solid modeling. I can also address menu customization issues and can help you find answers to questions I can`t answer by taking your question directly to Autodesk via their newsgroups.

Experience

I used to do electronic and mechanical design for a flat panel monitor manufacturer, and now I do architectural drafting for an architect. I did and do AutoLISP and menu customization and take pride in making my lisp routines to do the work exactly the way the client likes them done.

Publications
I had a routine published in CADENCE magazine (no longer in publication and taken over by CADALYST). Some of my routines are published on my website at http://my.sterling.net/~bdeshawn

©2012 About.com, a part of The New York Times Company. All rights reserved.