Offset polyline & create selection set

Offset polyline & create selection set

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

Offset polyline & create selection set

Anonymous
Not applicable

Hello everyone,

How would I offset a polyline with LISP, then set the newly created polyline to a named selection set (like myObj for example)? The outer green line shown in the screenshot below represents the "newly created" polyline, whereas the inner white line would be the original. I am a bit familiar with selection sets and naming conventions, but can't figure out how to ID the line (especially when it's in a complex drawing). Thank you for any assistance.

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

Ranjit_Singh
Advisor
Advisor
Accepted solution

I assume you are able to create a polyline with lisp. Now, if you call (entlast) right after the offset polyline is created then it will return the last entity (in your case the new polyline)

(setq myobj (ssadd (entlast)))

using below should also give the same result 

(setq myobj (ssget "_l"))
0 Likes
Message 3 of 4

stevor
Collaborator
Collaborator

To elaborate,  a program outline:

1. select the target LYPOLYLINE entity,

2. verify its closed status

3. determine its rotation direction, via LeeMacs' LM:ListClockwise-p

4. offset by a 'command to a point -90 degree from a segement if CCW,

or +90 if CW

5. save the entity name resultant entity by '(entlast)

S
0 Likes
Message 4 of 4

Anonymous
Not applicable

Good call! Your trick worked perfectly. I never thought AutoCAD's object order would see it in such a way. Thanks a bunch!!

0 Likes