(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!
(setvar 'peditaccept 1) (if (ssget "_X" '((0 . "LWPOLYLINE"))) (command ".pedit" "m" "PREVIOUS" "" "w" "0" "" "" "" ""))
HTH