Jump to content

Recommended Posts

Posted

Heya folks.

 

I'm having a bit of trouble with my 2d drawings, and I was hoping someone could help out an autocad newbie. I'm trying to find a way to automatically sort the order that lines appear on my drawing.

 

Meaning that I want my Object Lines layer to always be on top, with my hidden lines layer to be second on top, centrelines third on top etc etc...

 

I've dabbled around with Draworder, but I've got some pretty big drawings and it would take a long time to go about it.

 

Any help or advice you can give would be greatly appreciated!

Posted

;; Moves all objects on the "object" layer to the front
(defun c:lf()
;; creates a selection set of all objects on the "object" layer.
 (setq sel1 (ssget "x" '((8 . "0"))))
;; Uses the draworder command to move the objects to the front
 (command "draworder" sel1 "" "front")
)


Courtacy of LeeMac....

 

 

You can use this and edit to suit.

Posted

Sorry for my ignorance mate, but how do I go about using the code? Do I just copy/paste it into autocad?

Posted

It's a Lisp routine. Please refer to the AutoCAD FAQ section of CADTutor. Look under Customisation. The topic header is "How do I use an AutoLisp routine?"

Posted

If someone wishes to try it first: select the code, copy it in the clipboard (CTRL+C), click in AutoCAD command line and paste the text (CTRL+V). AutoCAD should report that LF is loaded. So type LF in the command line to start the routine.

This way the program loads only in the current drawing session -meaning that you must reload it each time you wish to use it in other drawings- or even in the current one after you close/reopen it

Posted

Another command you might find useful for this and for future requirements is QSELECT.

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...