Autoliso doesn't work since Autocad 2019, HELP PLEASE!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear all,
I have the following autolisp which is running perfect for Autocad2018, but it doesn't work for Autocad2019.
What is the issue?
Thanks so much
(defun C:changehatchtoback ( / acblk acdoc acsel name obj processed )
(vl-load-com) (princ)
(setq acdoc (vla-get-activedocument (vlax-get-acad-object))
acblk (vla-get-blocks acdoc)
)
(if (ssget "_X" '((0 . "INSERT")))
(progn
(vlax-for block (setq acsel (vla-get-activeselectionset acdoc))
(if (not (member (setq name (vla-get-name block)) processed))
(
(lambda ( / lst )
(vlax-for obj (vla-item acblk name)
(if (AND (wcmatch (vla-get-layer obj) "*PATT*") (eq "AcDbHatch" (vla-get-objectname obj)))
(progn
(setq lst (cons obj lst))
)
)
)
(if lst
(vla-movetobottom (LM:SortentsTable (vla-item acblk name))
(vlax-make-variant
(vlax-safearray-fill
(vlax-make-safearray vlax-vbobject (cons 0 (1- (length lst)))) lst
)
)
)
)
(setq processed (cons name processed))
)
)
)
)
(vla-regen acdoc acallviewports)
)
)
(princ)
)
(defun LM:SortentsTable ( space / dict result )
(vl-load-com)
(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") )
)
)