×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

3DPOLY line

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

RE: 3DPOLY line

try "3DPOLY" in lieu of "POLYLINE" maybe ???

RE: 3DPOLY line

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources