srinak47 Posted January 27, 2014 Posted January 27, 2014 (edited) Hi Bro, Am Looking for a Lisp to Select/Picking a Line to create a Poly-line Over the same Line or arc or spline in a "Specified Layer" (setq cp (mapcar 'getvar '(cmdecho peditaccept))) (if (setq ss (ssget "_:L" '((0 . "LINE,SPLINE,ARC")))) Edited January 31, 2014 by srinak47 Quote
Tharwat Posted January 27, 2014 Posted January 27, 2014 Try this ... (defun c:2pl (/ cp ss) (setq cp (mapcar 'getvar '(cmdecho peditaccept))) (if (setq ss (ssget "_:L" '((0 . "LINE,SPLINE,ARC")))) (progn (mapcar 'setvar '(cmdecho peditaccept) '(0 1)) (command "_.pedit" "_m" ss "" "" "") (mapcar 'setvar '(cmdecho peditaccept) cp) ) ) (princ) ) Quote
MSasu Posted January 27, 2014 Posted January 27, 2014 The answer is simply the PEDIT command (bulit-in). With the addition that if you want to convert a spline into arcs and not lines made polyline, then look for FLATTEN command (also built-in). Quote
srinak47 Posted January 27, 2014 Author Posted January 27, 2014 Thanks for the Quick reply, i think this lisp is converting the original line to a Poly-line,, but i wanted to create a new poly-line over the line or arc or circle or even poly-line .... Like a duplicate line ofc in a "specified layer" so i can isolate them later... Instead of overdraw on the line am looking to pick and create a new POLY-LINE Try this ... (defun c:2pl (/ cp ss) (setq cp (mapcar 'getvar '(cmdecho peditaccept))) (if (setq ss (ssget "_:L" '((0 . "LINE,SPLINE,ARC")))) (progn (mapcar 'setvar '(cmdecho peditaccept) '(0 1)) (command "_.pedit" "_m" ss "" "" "") (mapcar 'setvar '(cmdecho peditaccept) cp) ) ) (princ) ) Quote
srinak47 Posted January 27, 2014 Author Posted January 27, 2014 I think this also same as converting the line to poly line.... am looking for creating a new poly line. Quote
MSasu Posted January 27, 2014 Posted January 27, 2014 Please set the DELOBJ system variable to 0 to preserve original entities (although seems to works only for splines). Or add this line to above code: ... (progn (mapcar 'setvar '(cmdecho peditaccept) '(0 1)) [color=magenta] (command "_COPY" ss "" '(0.0 0.0) '(0.0 0.0)) [/color] (command "_.pedit" "_m" ss "" "" "") (mapcar 'setvar '(cmdecho peditaccept) cp) ) ... Quote
srinak47 Posted January 27, 2014 Author Posted January 27, 2014 (edited) yeah its working ... but 2 things 1.its creating a duplicate pline in the same layer,, i wanted that new pline to create in a specified layer for Eg.. "A_AREA-PL" 2.the new pline wont join together automatically or i have to pedit once after this....? But this made my work to half,, thanks a lot man.................. i must owe you a beer Edited January 27, 2014 by srinak47 errror Quote
MSasu Posted January 27, 2014 Posted January 27, 2014 You didn't said above about joining the plines. ... (progn (mapcar 'setvar '(cmdecho peditaccept) '(0 1)) [color=magenta] (command "_COPY" ss "" '(0.0 0.0) '(0.0 0.0)) (command "_CHPROP" ss "" "LA" "A_AREA-PL" "") [/color] (command "_.pedit" "_m" ss "" [color=magenta]"_J" "0.0" ""[/color]) (mapcar 'setvar '(cmdecho peditaccept) cp) ) ... Quote
srinak47 Posted January 27, 2014 Author Posted January 27, 2014 (edited) So great :):):):):) Last thing..... New P-LINE Draworder to come up..... right now new p-line creates below the line.... Edited January 31, 2014 by srinak47 Quote
MSasu Posted January 27, 2014 Posted January 27, 2014 To further cannibalize Tharwat's code: ... (progn (mapcar 'setvar '(cmdecho peditaccept) '(0 1)) [color=magenta] (command "_COPY" ss "" '(0.0 0.0) '(0.0 0.0))[/color] [color=magenta] (command "_CHPROP" ss "" "_LA" "A_AREA-PL" "")[/color] [color=magenta] (command "_DRAWORDER" ss "" "_F")[/color] (command "_.pedit" "_m" ss "" [color=magenta]"_J" "0.0" ""[/color]) (mapcar 'setvar '(cmdecho peditaccept) cp) ) ... Quote
srinak47 Posted January 27, 2014 Author Posted January 27, 2014 (edited) thanks and also customized what i required Edited January 31, 2014 by srinak47 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.