Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create polyline from a list.

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
779 Views, 4 Replies

Create polyline from a list.

I'm trying to input sequencial points from a list into a command line function. I can't seem to get the command to accept more than one point. What I am ultimately making is a function that selects everything within a selected polyline. This is my test:

(defun c:eb ()

(setq obj(entget (car (entsel"\nSelect the Polygon"))))
(setq objNum (cdr (assoc 90 obj))); Number of Vertices
(setq verts (get-vertices obj))
(setq N 0)
;(setq NStr (itoa N))
;(setq final (strcat "(nth " NStr " verts)"))
(setq final (nth N verts))
(setq objNum (- objNum 1))
(repeat objNum
(setq N (+ N 1))
(setq NStr (itoa N))
;(setq final (strcat final "(nth " NStr " verts)"))
(setq final (append final (nth N verts)))
); End repeat
(command "pline" final pause)
(princ)
); End defun
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

(command "pline")
(foreach n pointlist
(command n)
);;end foreach
(command "") or (command "cl")

Bill
Message 3 of 5
Anonymous
in reply to: Anonymous

or

(command ".pline")
(apply 'command lst)
(command "c")

--

-Jason
Member of the Autodesk Discussion Forum Moderator Program


"visualrider" wrote in message
news:f17902e.-1@WebX.maYIadrTaRb...
> I'm trying to input sequencial points from a list into a command line function.
Message 4 of 5
Anonymous
in reply to: Anonymous

Thanks Jason and Bill! I'm using Jasons code because of it's simplicity. My tests are working fine so far for simple closed polylines, but a road edge that I'm clipping out the topo from is giving me the error: "polygon segment is zero length". With some loop checking I should be able to get rid of these points from my list I guess. Thanks again guys.
Message 5 of 5
Anonymous
in reply to: Anonymous

Glad I could help, although I picked up that (apply....)
bit from Tony T.

--

-Jason
Member of the Autodesk Discussion Forum Moderator Program


"visualrider" wrote in message
news:f17902e.2@WebX.maYIadrTaRb...
> Thanks Jason and Bill! I'm using Jasons code because of it's simplicity.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta