tiwari1211 Posted April 30, 2021 Posted April 30, 2021 Dear lisp experts, I am looking for a Lisp to convert all the region in a drawing to Ploy-line. I found below lisp online but it doesn't work. Can any one please help me to provide such lisp. Thank you very much. (defun c:Region2Polyline nil (if (setq ss (ssget "_x" '((0 . "REGION")))) (:Region2Polyline ss) ) (princ) ) 1 Quote
mhupp Posted April 30, 2021 Posted April 30, 2021 (edited) What you posted only makes a selection set of Regions and then runs something else with that selection set. Might have been part of a bigger lisp. yep you need the lisp from the first post. looks like that does alot more stuff then what i posted and has error handling. ;;----------------------------------------------------------------------;; ; Region To Polyline (defun C:R2P (/ SS LastEnt en) (if (setq ss (ssget "_x" '((0 . "REGION")))) (progn (setq LastEnt (entlast)) (vl-cmdf "_.Explode" SS) (if (setq en (entnext LastEnt)) (while en (ssadd en SS) (setq en (entnext en)) ) ) (vl-cmdf "_.Join" SS "") ;(sssetfirst nil SS) ;uncomment if you want them selected after lisp ends ) (princ "No Regions in the Drawing") ) (princ) ) --edit-- forgot the princ Edited May 1, 2021 by mhupp 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.