0 Members and 1 Guest are viewing this topic.
Lee,This seem too simple. Check the Annotation property of the leader object. If it returns an mtext object...
I see no way but to search through all reactors.
(defun isLeaderText (ent) (and (assoc 102 (entget ent)) (setq own (cdr (assoc 330 (entget ent)))) (eq "LEADER" (cdr (assoc 0 (entget own))))))
You might be able to still do it that way with ODBX.
Nice idea Crank, thanks But I really need to do this with VL, as I'd be using it through ObjectDBX. But, on the topic of testing the text for a leader using dxf, I normally use something like this:Code: [Select](defun isLeaderText (ent) (and (assoc 102 (entget ent)) (setq own (cdr (assoc 330 (entget ent)))) (eq "LEADER" (cdr (assoc 0 (entget own))))))Not sure if that's a good way to do it though
In early '08, I wrote a routine that would copy (with option to delete) text objects with the QLeader command and change to the current layer. I used the same method to find and delete the attached leader. It did have a flaw that if the MText object had an associated leader, yet already deleted, an executed entdel on an already deleted leader would recreate it. I never followed through with figuring it out since we switched to Multileaders shortly after and I haven't used it since.
Quote from: alanjt on March 26, 2010, 02:35:10 PMIn early '08, I wrote a routine that would copy (with option to delete) text objects with the QLeader command and change to the current layer. I used the same method to find and delete the attached leader. It did have a flaw that if the MText object had an associated leader, yet already deleted, an executed entdel on an already deleted leader would recreate it. I never followed through with figuring it out since we switched to Multileaders shortly after and I haven't used it since.Just FYI... you can see if an entity is deleted a couple of ways. If ' entget ' returns nil, then it has been deleted. You can also use ' vlax-erased-p ' on an ename or vla-object.