Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Edit Polyline

3 REPLIES 3
Reply
Message 1 of 4
mwhea
367 Views, 3 Replies

Edit Polyline

  (ssget "_X" '((0 . "LWPOLYLINE")))			; gets all polylines for seletion set
  (command ".pedit" "m" "PREVIOUS" "" "w" "0" "" "" "" "")	; gets previous selection from above and edits

 

I use the above code for cleaning up architectural polylines and changing the properties to as we like to display it. Recently i have started batch scripting jobs and I have come to a problem with this script. The problem being if there are no polylines in the drawing the lisp routine fails and asks user to select objects as there was no "previous" selection set from the ssget. Is there a way to have it so that it will run the pedit if polylines were found in the selection set and to skip this section if there was no selection set found? 

 

I have also found that sometimes the script asks to turn arcs/splines/lines into polylines which also puts the batch process to a halt as (command ".pedit" "m" "PREVIOUS" "" "w" "0" "" "" "" "") doesn't take into account the "y or n" and the precision for spline conversion. 

 

Any help in this would be appreciated 🙂 thanks! 

3 REPLIES 3
Message 2 of 4
pbejse
in reply to: mwhea

(setvar 'peditaccept 1)
(if (ssget "_X" '((0 . "LWPOLYLINE")))			
  	(command ".pedit" "m" "PREVIOUS" "" "w" "0" "" "" "" ""))

 

HTH

 

Message 3 of 4
mwhea
in reply to: pbejse

Worked as needed.

 

Thanks Pbejse

Message 4 of 4
pbejse
in reply to: mwhea

Good for you mwhea

 

Cheers

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost