0 Members and 1 Guest are viewing this topic.
Marco(vlax-invoke (vlax-ename->vla-object EntNam) "Explode")does NOT return an OBJECTS LISTas you suppose in your code . . .<CLIP>
(setq SS_Out (ssadd))(foreach ObjFor (vlax-invoke (vlax-ename->vla-object EntNam) "Explode") (cond ( (wcmatch (strcase (vla-get-ObjectName ObjFor)) "*LINE")) (ssadd (vlax-vla-object->ename ObjFor) SS_Out) ) ( T (vla-delete ObjFor) ) ))
Marco<clip>because obj-lst is not an objects list.It is not a list.It is NIL
comando: (setq x-en (car (entsel)))Selezionare oggetto: <Nome entità: 7ff498414f70>Comando: (print (entget x-en))((-1 . <Nome entità: 7ff498414f70>) (0 . "INSERT") (330 . <Nome entità: 7ff498414820>) (5 . "77") (100 . "AcDbEntity")(67 . 0) (410 . "Model") (8 . "0") (62 . 1) (100 . "AcDbBlockReference") (2 . "arrows8") (10 394.512 49.3879 0.0) (41 . 0.5) (42 . 0.5) (43 . 0.5) (50 . 0.0) (70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0))((-1 . <Nome entità: 7ff498414f70>) (0 . "INSERT") (330 . <Nome entità: 7ff498414820>) (5 . "77")(100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (62 . 1) (100 . "AcDbBlockReference") (2 . "arrows8") (10 394.512 49.3879 0.0) (41 . 0.5) (42 . 0.5) (43 . 0.5) (50 . 0.0) (70 . 0)(71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0))Comando: (setq obj-lst (vlax-invoke (vlax-ename->vla-object x-en) "Explode"))(#<VLA-OBJECT IAcadHatch 000000003852d818> #<VLA-OBJECT IAcadLWPolyline 000000003852d158>)Comando: (progn (foreach x-obj obj-lst (print (vla-get-ObjectName x-obj))) (princ))"AcDbHatch""AcDbPolyline"
I don't understand !do you understand ?
Comando: (defun c:k ()(_> (vl-load-com)(_> (setq x-en (car (entsel) ) )(_> (print x-en) (princ)(_> (setq x-el (entget x-en) )(_> (print x-el) (princ)(_> (setq obj-lst (vlax-invoke (vlax-ename->vla-object x-en) "Explode") )(_> (print obj-lst) (princ)(_> (foreach x-obj obj-lst (print (vla-get-ObjectName x-obj) ) (princ) )(_> )C:KComando: kSelezionare oggetto:<Nome entità: 7ff462103f70>((-1 . <Nome entità: 7ff462103f70>) (0 . "INSERT") (330 . <Nome entità: 7ff462103820>) (5 . "77") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (62 . 1) (100 . "AcDbBlockReference") (2 . "arrows8") (10 394.512 49.3879 0.0) (41 . 0.5) (42 . 0.5) (43 . 0.5) (50 . 0.0) (70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0))(#<VLA-OBJECT IAcadHatch 0000000035673c98> #<VLA-OBJECT IAcadLWPolyline 0000000035673b18>)"AcDbHatch""AcDbPolyline"
Maybe check if the insert is in fact explodable?