Lisp Convert Objects To Polyline one time

Lisp Convert Objects To Polyline one time

Anonymous
Not applicable
3,945 Views
6 Replies
Message 1 of 7

Lisp Convert Objects To Polyline one time

Anonymous
Not applicable

Dears

 

I'm searching for lisp to change all objects(Circle, Arc , Line, ... etc.) to Polyline direct, all selected in one time.

 

Thanks for your support.

0 Likes
Accepted solutions (1)
3,946 Views
6 Replies
Replies (6)
Message 2 of 7

maratovich
Advisor
Advisor
^C^C(defun C:JPL ( / ope ssnab )(setq ope (getvar "PEDITACCEPT"))(setvar "PEDITACCEPT" 1)(setq ssnab (ssget "_I"))(while (not ssnab)(setq ssnab (ssget)))(command "_pedit" "_Multiple" ssnab "" "_Join" 0 "")(setvar "PEDITACCEPT" ope)(setq ssnab nil)(princ));JPL;
---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 3 of 7

Kent1Cooper
Consultant
Consultant

@maratovich wrote:
...(command "_pedit" ....

PEDIT won't do Circles.  For that, try CirclePolylineSwap.lsp >here<.  A routine could be built that would do that or equivalent to Circles, and use PEDIT on other things.

Kent Cooper, AIA
Message 4 of 7

Kent1Cooper
Consultant
Consultant

@maratovich wrote:
....(command "_pedit" ... "_Join" ....

And there's a question for you, @Anonymous :  Do you want Lines and Arcs merely converted to single-segment Polylines individually, or do you want them Joined together where possible?  If you want them Joined, do you also want any already-existing Polylines that touch their ends also Joined to them?  The answer to that will affect what is permitted in object selection.

Kent Cooper, AIA
0 Likes
Message 5 of 7

ВeekeeCZ
Consultant
Consultant
Accepted solution

@Anonymous wrote:

... to change all objects(Circle, Arc , Line, ... etc.) to Polyline direct, all selected in one time. ...


 

This could help you even with most of those red ones.

Thanks to @_gile  for most of the subs.

0 Likes
Message 6 of 7

Anonymous
Not applicable

Great, It's working as I need, thanks very much. 

0 Likes
Message 7 of 7

Anonymous
Not applicable

I need all Joined together. if also Join with any existing Polylines that touch their ends it will be great.

0 Likes