TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: uncoolperson on July 24, 2008, 11:15:22 AM
-
normally i'd jump at the chance to write something up, but right now i just don't have the time to deal with screwing it up, and fixing it.
anyone have some lisp out there that will grab all the insertion points and end points of the entities in a selection set?
Thanks
-
What entity types are in the ss?
-
More specific???? Insertion points of Text, Mtext, Attributes, Blocks, all of these? End points of lines, arcs, plines, splines, all of these?
-
Here is one way.
(defun c:Test (/ ss Ent PtList EntData EntType)
(if (setq ss (ssget))
(while (setq Ent (ssname ss 0))
(setq EntData (entget Ent))
(setq EntType (cdr (assoc 0 EntData)))
(setq PtList
(cond
(
(or
(= EntType "INSERT")
(= EntType "MTEXT")
)
(cons (cdr (assoc 10 EntData)) PtList)
)
((= EntType "TEXT")
(cons
(if
(and
(equal (cdr (assoc 72 EntData)) 0)
(equal (cdr (assoc 73 EntData)) 0)
)
(cdr (assoc 10 EntData))
(cdr (assoc 11 EntData))
)
PtList
)
)
(t
(cons
(vlax-curve-getStartPoint Ent)
(cons
(vlax-curve-getEndPoint Ent)
PtList
)
)
)
)
)
(ssdel Ent ss)
)
)
PtList
)
-
I think that should cover it, thanks... new guy doesn't get "on the grid", and it's driving me insane.