PDA

View Full Version : Draworder Bylayer?



djopr
2004-12-28, 02:51 PM
Can Draw Order be set by layer? I have lots of layers and many small objects in these layers and when I plot I would like to control the draw order of these entities easily. Thanks in advance, DJO

Mike.Perry
2004-12-28, 04:27 PM
Hi

Not directly in the way I think you are hoping.

You could use _.QSelect or something similar to build a selection set based of your criteria then use the _.Draworder command on the selection set created.

A search within the Forums should turn-up more information on Draworder -

Search Forums (http://forums.augi.com/search.php?)

Have a good one, Mike

Ed Jobe
2004-12-28, 05:18 PM
I had this lisp called TOP. I modified it to change a whole layer at a time.


;;; Top.lsp - move to top of draworder
(defun c:Top (/ selset)
(prompt "Select entities to move to top of draworder. ")
(setq selset (ssget))
(command "copy" selset "" "@" "@") ;copy at same location puts ents higher in database
(command "erase" selset "") ;erase previous ents
(command "redraw")
(princ)
)

;;; LayerOnTop.lsp
;;; Moves all ents on selected layer to top of draworder.
(defun c:LayerOnTop (/ selset lay)
(prompt
"Select an entity on the layer to move to top of draworder. "
)
(setq selset (ssget ":S"))
(setq lay (cdr (assoc '8 (entget (ssname selset 0)))))
(setq selset (ssget "x" (list (cons 8 lay))))
(command "copy" selset "" "@" "@") ;copy at same location puts ents higher in database
(command "erase" selset "") ;erase previous ents
(command "redraw")
(princ)
)

Mike.Perry
2004-12-28, 05:40 PM
I had this lisp called TOP. I modified it to change a whole layer at a time. Hi Ed

Nice :)

In my defence the only reason I didn't refer to your Exchange submission was due to the person running AutoCAD LT, but if they are running some Third Party piece of Software that enables ARX, LISP, VBA etc then your above offering should prove very useful.

:beer: Mike

Ed Jobe
2004-12-28, 06:17 PM
Duh, forgot what forum I was in. :shock: :Oops: Oh, well, maybe someone else can use it. You had a good idea though, this lisp just automates your idea.