Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Deleting datalinks

etilley327KA
Advocate

Deleting datalinks

etilley327KA
Advocate
Advocate

I'm looking for a way to delete all the datalinks at once from a drawing without exiting. I've got this, but it's not working, I keep getting object is referenced by other objects.

 

(defun c:dfg (/ data)
(if (setq data (dictsearch (namedobjdict) "ACAD_DATALINK"))
  (vla-delete (vlax-ename->vla-object (cdr (assoc -1 data))))
)  
)
0 Likes
Reply
248 Views
2 Replies
Replies (2)

paullimapa
Mentor
Mentor

perhaps try this solution found by doing a searh on-line:

How to completely delete a table data link - AutoCAD Drawing Management & Output - AutoCAD Forums (c...

(dictremove (namedobjdict) "ACAD_DATALINK")

then save and close the drawing, reload drawing 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes

etilley327KA
Advocate
Advocate

Yes, ive seen that and used it, but im looking for a way to do it without closing the drawing.

0 Likes