0 Members and 1 Guest are viewing this topic.
Otherwise, try using the ActiveX methods to modify object order. For an example see the code I used in post #4 here (with Lee Mac's help of course!)
Do these crash for you?http://lee-mac.com/draworderfunctions.html
Quote from: Lee Mac on June 20, 2012, 09:54:45 AMDo these crash for you?http://lee-mac.com/draworderfunctions.htmlFirstly - 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] ;;;--------------------------------------------------------------------;(defun c:TOP ( / ss) (if (setq ss (ssget)) (LM:MoveToTop (LM:acDoc) ss)) (princ));;;--------------------------------------------------------------------;(defun c:BOTTOM ( / ss) (if (setq ss (ssget)) (LM:MoveToBottom (LM:acDoc) ss)) (princ));;;--------------------------------------------------------------------;(defun LM:acDoc () (cond (acDoc) ((setq acDoc (vla-get-activedocument (vlax-get-acad-object)))))) ... 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