PDA

View Full Version : Spline Control Points


bowtle
2009-07-28, 07:41 AM
Surely this has to be a simple matter, but I am darned if i can figure it out ... going crazy searching Autocad help files for any help!

Can someone point me to what I need to do to extract all the control points from a spline.

I can get the first point using (assoc 11), but cant figure how to get the rest.

I thought I was getting better at lisp until i ran into this ...

Thanks

((-1 . <Entity name: 7ee44278>)
(0 . "SPLINE")
(330 . <Entity name: 7ee40ee8>)
(5 . "62F")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbSpline")
(210 0.0 0.0 1.0)
(70 . 8)
(71 . 3)
(72 . 11)
(73 . 7)
(74 . 5)
(42 . 1.0e-010)
(43 . 1.0e-010)
(44 . 2.54e-008)
(40 . 0.0)
(40 . 0.0)
(40 . 0.0)
(40 . 0.0)
(40 . 316.228)
(40 . 644.252)
(40 . 866.288)
(40 . 1018.6)
(40 . 1018.6)
(40 . 1018.6)
(40 . 1018.6)
(10 0.0 0.0 0.0)
(10 50.9808 142.829 0.0)
(10 154.844 433.816 0.0)
(10 445.514 -115.255 0.0)
(10 533.695 310.044 0.0)
(10 659.012 217.61 0.0)
(10 710.0 180.0 0.0)
(11 0.0 0.0 0.0)
(11 180.0 260.0 0.0)
(11 440.0 60.0 0.0)
(11 570.0 240.0 0.0)
(11 710.0 180.0 0.0)

devitg.89838
2009-07-28, 12:08 PM
Surely this has to be a simple matter, but I am darned if i can figure it out ... going crazy searching Autocad help files for any help!

Can someone point me to what I need to do to extract all the control points from a spline.

I can get the first point using (assoc 11), but cant figure how to get the rest.

I thought I was getting better at lisp until i ran into this ...

Thanks

((-1 . <Entity name: 7ee44278>)
(0 . "SPLINE")
(330 . <Entity name: 7ee40ee8>)
(5 . "62F")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbSpline")
(210 0.0 0.0 1.0)
(70 . 8)
(71 . 3)
(72 . 11)
(73 . 7)
(74 . 5)
(42 . 1.0e-010)
(43 . 1.0e-010)
(44 . 2.54e-008)
(40 . 0.0)
(40 . 0.0)
(40 . 0.0)
(40 . 0.0)
(40 . 316.228)
(40 . 644.252)
(40 . 866.288)
(40 . 1018.6)
(40 . 1018.6)
(40 . 1018.6)
(40 . 1018.6)
(10 0.0 0.0 0.0)
(10 50.9808 142.829 0.0)
(10 154.844 433.816 0.0)
(10 445.514 -115.255 0.0)
(10 533.695 310.044 0.0)
(10 659.012 217.61 0.0)
(10 710.0 180.0 0.0)
(11 0.0 0.0 0.0)
(11 180.0 260.0 0.0)
(11 440.0 60.0 0.0)
(11 570.0 240.0 0.0)
(11 710.0 180.0 0.0)


Use this defun

(DEFUN massoc (key EntData / x nlist)
(FOREACH x EntData
(IF (EQ key (CAR x))
(SETQ nlist (CONS (CDR x) nlist))
) ;_ end of if
) ;_ end of foreach
(REVERSE nlist)
)

(setq control-point-list (massoc 11 (entget (car ( entsel "\nSelect spline")))))

bowtle
2009-08-10, 03:57 AM
Sorry it took so long, Thank you

irneb
2009-08-10, 03:15 PM
http://forums.augi.com/showthread.php?t=104434

Similar, but also shows how to edit a particular item even if it has duplicates.