teknomatika Posted February 25, 2016 Posted February 25, 2016 Dearest In this routine, I intend it to be converted the region into a pline but intend at the same time be preserved region. Thanks. ;;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/region-to-polyline/td-p/2432294;; ;;somebudy;; (defun c:r2p ( / ename old_cmdecho) (if (setq ename (car (entsel))) (if (= (cdr (assoc 0 (entget ename))) "REGION") (progn (setq old_cmdecho (getvar 'cmdecho)) (setvar 'cmdecho 0) (command "_.undo" "_begin") (command "_.explode" ename) (command "_.pedit" "_m" (ssget "_p") "" "_y" "_j" 0.0 "") (command "_.undo" "_end") (setvar 'cmdecho old_cmdecho) ) (prompt "\nThe selected object is not a region.") ) (prompt "\nNothing selected.") ) (princ) ) Quote
Hippe013 Posted February 25, 2016 Posted February 25, 2016 Insert (command "copy" ename "" "d" '(0 0 0)) Prior to (command "_.explode" ename) Quote
marko_ribar Posted February 25, 2016 Posted February 25, 2016 And change (command "_.explode" ename) To (command "_.explode" (entlast)) So that picked entity remains intact and operations that follow are performed on copy of picked REGION entity... Quote
Hippe013 Posted February 25, 2016 Posted February 25, 2016 You may also want to look into PEDITACCEPT. If PEDITACCEPT is set to one this function will fail. Maybe you should get the old value of PEDITACCEPT then set it to zero and at the end set it back to the old PEDITACCEPT. The same way you do it with CMDECHO. 1 Quote
teknomatika Posted February 26, 2016 Author Posted February 26, 2016 Thanks! Results , but the polyline is represented alongside displaced . I intend that overlaps the region . 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.