Otherwise, try using the ActiveX methods to modify object order. For an example see the code I used in post #4 here (http://forums.augi.com/showthread.php?130229-Send-objects-%28wipeouts%29-to-back) (with Lee Mac's help of course!)
Do these crash for you?
http://lee-mac.com/draworderfunctions.html (http://lee-mac.com/draworderfunctions.html)
Do these crash for you?
http://lee-mac.com/draworderfunctions.html (http://lee-mac.com/draworderfunctions.html)
Firstly - Most excellent, Lee... I had not come across the MoveTo* Methods before.
That said, while the code does not bomb, I am having trouble with selecting entities through an active PViewport, due to (cons 410 (getvar 'ctab)). I can obviously correct this, but just thought I'd share in the event you wanted to update source code on your website.
[OffTopic]
Lee -
No obligation of course, but if I may, for your consideration:Code - Auto/Visual Lisp: [Select]
;;;--------------------------------------------------------------------; ;;;--------------------------------------------------------------------; ;;;--------------------------------------------------------------------;
... As precluding entities on locked layers is not necessary, given that AI_DRAWORDER works with locked layers as well. This also allows for selection through an active PViewport.
** Edit - Forgot to express my dissapointment with LISP; not being able to add vla-Start/End*UndoMark is frustrating.
** Note - Attribution of LM:acDoc is for pseudo purposes, and shall be used at LM's discretion only.
[/OffTopic]
Lee, those work, thank you! Am I allowed to use them in commercial code?
Lee, the command
(vla-AddObject dict "ACAD_SORTENTS" "AcDbSortentsTable")
fails for me in Autocad 2010. I think this affects your sortents routines too - they seem to handle it by failing silently.
error: bad argument type: VLA-OBJECT
error: bad argument type: VLA-OBJECT nil
might want to give it a try to this function: VxSetDrawOrder - from one of the old masters in the lispy world...
here:
http://www.menziengineering.ch/Downloads/Download.htm
The error means that the clas sname is not registered, which means the .arx module is not loaded. Does the DRAWORDER command work? If so, use it to demand load the module before attempting to use it. If not, check your DEMANDLOAD system variable setting.
(if (not (member "acdorder.arx" (arx)))
(arxload "acdorder.arx" nil)
)