Hi,
I use this code with AutoCAD 2016 and it work perfect but we get the AutoCAD 2018 and the last few days I receive this message:
** Error: Automation Error. Description was not provided. **
(defun c:delinvb (/ acdoc ss i sset nme Blockdefinition)
(vl-load-com)
(setq acdoc (vla-get-activedocument
(vlax-get-acad-object)
)
)
(if (setq ss (ssget "_:L" '((0 . "INSERT"))))
(repeat
(setq i (sslength ss))
(setq sset (ssname ss (setq i (1- i))))
(setq nme (cdr (assoc 2 (entget sset))))
(setq Blockdefinition (vla-item (vla-get-blocks acdoc) nme))
(if
(and
(eq :vlax-false (vla-get-isxref Blockdefinition))
(eq :vlax-false (vla-get-islayout Blockdefinition))
)
(vlax-for x Blockdefinition
(if(=(vla-get-Visible x) :vlax-false)
(vla-delete x)
)
)
)
)
(princ)
)
(vla-regen acdoc acAllViewports)
(princ)
)
Could somebody help me to figure out what happens ?
(I found this code here
http://www.theswamp.org/index.php?topic=32681.msg495238#msg495238)
Kind regards
Bluebird1973