Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

3DPOLY line

Status
Not open for further replies.

MKV

Mechanical
Joined
Oct 29, 2002
Messages
8
Location
DE
Hi
I am trying to draw a 3D line using autolisp's entities. The
code looks like this:

(setq i (- 0 1))
(entmake (list (cons 0 "POLYLINE") ; Object
(cons 100 "AcDbEntity")
(cons 8 "L1") ; Layer name
(cons 100 "AcDb3dPolyline")
(cons 62 3))) ; Color

(repeat indx ;indx= size of the array ptlst
;which holds X,Y,Z coordinates
(entmake (list (cons 0 "VERTEX")
(cons 100 "AcDbEntity")
(cons 8 "L1")
(cons 100 "AcDbVertex")
(cons 100 "AcDb3dPolylineVertex")
(cons 10 (nth (setq i (1+ i)) ptlst))))
)
(entmake '((0 . "SEQEND")
(100 . "AcDbEntity")
(8 . "L1"))
This just produces a 2D line. I tried to extract the entity info as: (setq e (entget (car (entsel)))) and selected the above line. It produces:

(100 . "AcDb2dPolyline") (100 . "AcDb2dVertex") etc.

On the other hand if I use the same data set and read it as a script file it produces the correct curve.
Could any one tell where I am doing wrong in the above code?
Thank you
MKV
 
try "3DPOLY" in lieu of "POLYLINE" maybe ???
 
Hi...

Is more easy with the ForEach function.

(command "_.3dpoly")
(foreach pt list-point
(command "_.3dpoly" pt)
)
(command "")

the list-point variable have all points of the 3DPOLYLINE.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top