3DPOLY line
3DPOLY line
(OP)
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
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





RE: 3DPOLY line
RE: 3DPOLY line
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.