How to differentiate between a line and polyline in AutoLISP?

How to differentiate between a line and polyline in AutoLISP?

Anonymous
Not applicable
1,245 Views
3 Replies
Message 1 of 4

How to differentiate between a line and polyline in AutoLISP?

Anonymous
Not applicable

I give up...just how does AutoLISP differentiate between lines and polylines?  I'm trying to write some LISPS that place lines and polylines on differing layers, depending on their lengths, number of vertices, etc...

 

I can manipulate polylines just fine, but the lines will not cooperate at all.  It is crucial that I can distinguish between the two entities, as this is the gateway to a much larger set of projects.  

 

Please see the attached files, it's pretty simple what I'm trying to do, if someone could help me get the lines to cooperate I'd be very grateful.  Thanks in advance for any help!

0 Likes
Accepted solutions (1)
1,246 Views
3 Replies
Replies (3)
Message 2 of 4

Ranjit_Singh
Advisor
Advisor
Accepted solution

Your line test is checking for "Line". It should be "AcDbLine". Try the attached.

Message 3 of 4

Shneuph
Collaborator
Collaborator

It looks like you're very close.. only a Line is ObjectName (RO) = "AcDbLine" and polyline is ObjectName (RO) = "AcDbPolyline".  Also, ObjectName (RO) = "AcDb3dPolyline" for 3D polylines.  Use vlax-dump-object function to inspect properties.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 4 of 4

Anonymous
Not applicable

Thank you both for the help!  I guess I had the "Line" and "AcDbLine" positions mixed-up in my way of thinking.

0 Likes