PDA

View Full Version : Lisp that sends wipeouts to the back of the drawortder inside blocks not working in 2019



jpcadconsulting347236
2019-08-29, 05:07 PM
Hiya gang,

Lee Mac wrote this lisp for me a while back that send wipeouts inside blocks to th eback of the draworder. It worked great for years and now in AutoCAD 2019, it seems to have stopped working.

Hopeing somebody can shed some light on this for me.

Lee Mac's Code:



(defun c:BlockWipeoutToBack (/ acdoc)
;; Lee Mac 20.06.11
(setq acdoc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for block (vla-get-blocks acdoc)
(if
(and
(eq :vlax-false (vla-get-islayout block))
(eq :vlax-false (vla-get-isxref block))
)
(
(lambda (/ lst)
(vlax-for obj block
(if (eq "AcDbWipeout" (vla-get-objectname obj))
(setq lst (cons obj lst))
)
)
(if lst
(vla-movetobottom
(LM:SortentsTable block)
(vlax-make-variant
(vlax-safearray-fill
(vlax-make-safearray
vlax-vbobject
(cons 0 (1- (length lst)))
)
lst
)
)
)
)
)
)
)
)
(vla-regen acdoc acallviewports)
(princ)
)
(defun LM:SortentsTable (space / dict result)
(cond
(
(not
(vl-catch-all-error-p
(setq result
(vl-catch-all-apply
'vla-item
(list (setq dict (vla-GetExtensionDictionary space))
"ACAD_SORTENTS"
)
)
)
)
)
result
)
((vla-AddObject dict "ACAD_SORTENTS" "AcDbSortentsTable"))
)
)
(vl-load-com) (princ)

BlackBox
2019-08-29, 05:40 PM
Works fine here (C3D 2019.3)

jpcadconsulting347236
2019-08-29, 10:30 PM
Works fine here (C3D 2019.3)

Crazy. Maybe my blocks? Hard to believe all of them suddenly became unresponsive to this command. I've attached a file with a few. Does it still work for you?

BlackBox
2019-08-30, 02:06 PM
Crazy. Maybe my blocks? Hard to believe all of them suddenly became unresponsive to this command. I've attached a file with a few. Does it still work for you?

Still works fine here (C3D 2019.3):

107621

Rob_Miller
2019-08-30, 05:09 PM
Works in AutoCAD 2019.1.2 on my end, similar to BlackBox … have you added any new routines to your setup?

Tom Beauford
2019-08-30, 05:57 PM
Even works on my Civil 3D 2019 that doesn't have any updates.

jpcadconsulting347236
2019-09-04, 04:32 PM
Super weird.

Works fine in our NYC office, not in the Cambridge office. Same version, same support files...

Could it be some setting in AutoCAD or a driver issue?

jpcadconsulting347236
2019-09-04, 04:47 PM
Acad version is older in Cambridge. Updating now to see if that's it.

jpcadconsulting347236
2019-09-04, 05:03 PM
I'll be darned. After the update it works. Who knew?

Thanks for your help folks... always appreciated.

Now back to trying to wrap my brain around reactors. ;-)