Spline control points using autolisp

Discussion in 'AutoCAD' started by Imran Amin, Jun 4, 2004.

  1. Imran Amin

    Imran Amin Guest

    I'm working on a project using AutoLISP where i came to a point on how can i
    get spline control points after the first one.
    say a 33 control point spline
    the first spline is given by
    (setq sp1_list (entget sp1))
    (setq coord1 (cdr (assoc 10 sp1_list)))

    how about rest of it
    or just last one

    Imran Amin, Jun 4, 2004
    1. Advertisements

  2. Imran Amin

    bob.at Guest

    the last one you get with:

    (setq coord_last (cdr (assoc 10 (reverse sp1_list))))

    if you use all points you can step through the list:

    (setq coord_list nil)
    (while sp1_list
    (setq next_code (car sp1_list))
    (if (= (car next_code) 10)
    (setq coord_list (cons (cdr next_code) coord_list))
    (setq sp1_list (cdr sp1_list))
    (setq coord_list (reverse coord_list))

    bob.at, Jun 5, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.