Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Draworder Doesn't Stay Between Sessions

14 REPLIES 14
Reply
Message 1 of 15
Civil3DReminders_com
906 Views, 14 Replies

Draworder Doesn't Stay Between Sessions

I've modified a lisp routine I found on line. It works great in putting the draw order of objects, mainly sending blocks with hatches to the back, in the correct order. The problem is that if I print from SSM in the same Autocad session it prints correctly, if I exit Autocad and open a new session SSM prints the wrong draw order and the command needs to be run again. HPDRAWORDER and SORTENTS are set to the default values. Is there anything else I should check?

Autocad 2014
Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
14 REPLIES 14
Message 2 of 15

Chck into 'visretain' maybe?

Windows 7 Pro, HP Z400 w/Dual Acer Monitors, 24G Ram, AutoCAD 2013~2015e
Message 3 of 15

Thanks for the suggestion, unfortunately that it was set correctly and didn't affect the result setting it with the opposite value.

Message 4 of 15

Have you checked the DRAWORERCTL system variable?

Message 5 of 15

Are you saving your file(s) after running the lisp?
What exactly does the lisp do? "lisp" means nothing honestly, cood be sloppy or it could be irrelelvant for your true needs. post it here.
Message 6 of 15
doni49
in reply to: TheRuinner13


@TheRuinner13 wrote:

Chck into 'visretain' maybe?


Visretain controls whether or not layer changes to XRefs are retained.

 

i.e. You change XRef1|Layer1 so that it's off and XRef1|Layer2 so that it's blue.  Do you want those settings to be retained the next time you open the dwg file?



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 7 of 15


@Civil3DReminders_com wrote:
I've modified a lisp routine I found on line. It works great in putting the draw order of objects, mainly sending blocks with hatches to the back, in the correct order. The problem is that if I print from SSM in the same Autocad session it prints correctly, if I exit Autocad and open a new session SSM prints the wrong draw order and the command needs to be run again. HPDRAWORDER and SORTENTS are set to the default values. Is there anything else I should check?

Autocad 2014

I've seen this behavior in the past -- with no lisp routine involved -- and I have yet to notice a pattern as to when it happens vs not.  My work around when I run into this as of yet is: 

 

  1. Select everything I want "on top"
  2. Copy everything on top of itself
  3. ERASE the "previous selection" (the stuff that I just copied)

Now I'm left with ONLY the new copies of what was there.

The most recently created items are always "on top" until something else is placed on top of them.



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 8 of 15

Attached is the lisp file being used. Yes, the drawing is being saved after the lisp is run. 

 

Visretain didn't affect the results.

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 9 of 15

Thanks: I don't see your edits to it, what did you change? Lee Mac writes great lisps and nothing 'wrong' jumps out at me.
Message 10 of 15

Lee Mac had a dialog box where you could select the order manually from a list of layers. Unfortunately it didn't save the values, so the next time you went in it you'd have to select them again. Since the layers are always the same in my case I hard coded the layer list in the lisp program and when it runs, it does it based on the hard coded list of layers. I tried to contact Lee to get the dialog box to save the values, but unfortunately he didn't respond, even with the offer of money for his time.

 

The short answer is I removed the dialog box and added this instead:

(setq layers '("CURB" "POST" "CAISSON" "WALLSTEM" "WALLSTRUCT" "FOOTING GREY"))

 

previously the layers array was set by a dialog box showing a list of layers.

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 11 of 15


@Civil3DReminders_com wrote:
... The problem is that if I print from SSM in the same Autocad session it prints correctly, if I exit Autocad and open a new session SSM prints the wrong draw order and the command needs to be run again...
..

Without using SSM, just open, run LDOrder, save, close, reopen... the object order remained correct or not?

 

Henrique

EESignature

Message 12 of 15

Same result as using SSM, it looses the draw order previoiusly saved.

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 13 of 15

Could you please open the attached dwg, do a plot preview, and report what you see in the preview.

 

Henrique

EESignature

Message 14 of 15

Can you please share a non-confidential sample drawing to demonstrate the behavior ?

That will help reproduce the behavior and log it with our engineering team if needed.

 

I did not reproduce the behavior in AutoCAD 2014 with two simple overlapping hatches. 

The draw order when changed using Lee Mac's code as well as changing it directly in AutoCAD persisted between sessions.

I have attached the sample drawing that i used.

 

About changing Lee Mac's nice Lisp code to suit your needs :

 

Have a look at "(action_tile "add"... code

that is the code where the action related to clicking the "add" button is.

 

The following line :

(_MakeList   "layer2"  (setq layer2 layers))

should add all the layers to the "layer2" list box and you can have the layers sorted to suit your requirement.

 

You can also save the sorted order by creating another button (say "Save" button) and saving it to a file.

Have a look at the DCL code to add another button if you need that.

 

If you are comfortable programming in VB.Net, you can follow this blog post and saving to a file is quite easy

http://adndevblog.typepad.com/autocad/2012/06/changing-the-draw-order-of-the-entity.html

 

Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

Message 15 of 15
Anonymous
in reply to: doni49

thanks for this .. the incorrect draw order has been happening on drawings with several xrefs and multiple users' input - and it's been driving me nuts! this is a slick fix. 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report