Hello to all
with the help of some of you, in the past, I have written this routine to explode a block and save a selection set of the objects it contains.
(defun VxExpode (Ent / CurObj CurSet ObjLst)
(vl-load-com)
(setq CurSet (ssadd))
(setq CurObj (vlax-ename->vla-object Ent))
(setq ObjExp (vla-Explode (vlax-ename->vla-object Ent)))
(setq ObjLst (vlax-safearray->list (vlax-variant-value ObjExp)))
(foreach memb ObjLst
(setq CurSet (ssadd (vlax-vla-object->ename memb) CurSet))
)
(entdel ent)
CurSet
)
Unfortunately in AutoCAD 2011 (and perhaps even other ...) works well with normal blocks, but when he has to explode a block scaled not uniformly issues the following error:
The ActiveX server returned an error: Invalid index
Do you have any idea on how I can get around this problem?