TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: SPDCad on January 24, 2005, 03:48:07 PM

Title: Extract Polyline points.
Post by: SPDCad on January 24, 2005, 03:48:07 PM
Anyone have any quick code to extracting the points of a polyline.
I have seen it posted here or at Cadalog a little while back but I can't seem to find it.
I also have some code for this buried in one of my lisp, but that two I can’t seem to find.
Boy, I am having a bad day! I need a vacation.  :)
Title: Extract Polyline points.
Post by: Jeff_M on January 24, 2005, 04:44:32 PM
Here's one way:
Code: [Select]

(setq pline (car (entsel)))
(setq ent (entget pline))
(setq coords (mapcar 'cdr
    (vl-remove-if-not
      '(lambda (x)
 (= 10 (car x)))
   ent)))
Title: Extract Polyline points.
Post by: SPDCad on January 25, 2005, 10:27:47 AM
Thanks Jeff_M
Title: Extract Polyline points.
Post by: CAB on January 25, 2005, 04:47:05 PM
Jeff,
You sure know how to cut right to the problem.
Very nice solution. :)

CAB