Can I delete AEC Objects by lisp (or other method?)

Can I delete AEC Objects by lisp (or other method?)

Anonymous
Not applicable
2,759 Views
6 Replies
Message 1 of 7

Can I delete AEC Objects by lisp (or other method?)

Anonymous
Not applicable

HELLO ~~ I can not bind a xref which has the AEC Objects.So I want to explode or delete the AEC objects.How can I do with LISP.

0 Likes
Accepted solutions (2)
2,760 Views
6 Replies
Replies (6)
Message 2 of 7

_gile
Consultant
Consultant

Hi,

 

You can try with ZombieKiller.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 7

Anonymous
Not applicable

I also find ACAD_PROXY_ENTITY.What is that?And can I kill it too?

0 Likes
Message 4 of 7

_gile
Consultant
Consultant

See the topic.

You can try to kill them (make a bakup before...)



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 5 of 7

Anonymous
Not applicable

Thanks

0 Likes
Message 6 of 7

Anonymous
Not applicable
Accepted solution

I already know how to explode the "AcDbZombieEntity"("ACAD_PROXY_ENTITY")  when the drawing is activated.

Here is the code.

 

(defun AEC-explode (/ adoc ss)
(setq ss (ssget "X" '((0 . "ACAD_PROXY_ENTITY"))))
(if ss
(progn
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
(SSSETFIRST nil ss)
(vla-sendcommand adoc "Explode\r")
(vla-sendcommand adoc "Explode p \r")
)
)
)

 

 

I want to do this without open the drawing.And I have know how to find "AcDbZombieEntity",but I don't know how to explode.

 

Here is the code.

 

(defun c:tt( / )
	(setq dbx (Vlax-Get-Or-Create-Object "ObjectDBX.AxDbDocument.18" ))
	(setq path "C:/")
	(foreach file (vl-directory-files path "*.dwg" 1)
		(Vlax-Invoke-Method dbx 'Open (strcat path file) )
		(vlax-for ob (Vlax-Get dbx 'ModelSpace)
			(cond
				((= "AcDbZombieEntity" (Vlax-Get ob 'ObjectName ))
					    (vla-Explode ob);;;;;;How to explode,this code is wrong.
				)
			)
		)
		(Vlax-Invoke-Method dbx 'SaveAs (strcat path file))
	)
	(vlax-release-object dbx)
)

 

0 Likes
Message 7 of 7

_gile
Consultant
Consultant
Accepted solution

vla-explode does not apply to AcDbZombieEntity, according to your first message, you should try vla-Delete (wrapping it in a (vl-catch-all-apply ...) expression.

 

Anyway, typically AcDbZombieEntity objects come with non graphical AcDbZombieObject (as you can see with FINDZOMBIES or KILLZOMBIES commands). Most often, these objects are dictionary entries.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes