MR MAN Posted January 8, 2009 Posted January 8, 2009 Is There Any Way To Convert Lines To Polylines By Selecting Them ? Quote
Dipali Posted January 8, 2009 Posted January 8, 2009 type 'pedit' at the commnad line & selct the line. when it only line it will ask 'do you want to turn it inot one' say 'yes' & than use join option to add other lines to it if required. If you set up 'peditaccept' value to '1' it iwl supress that prompt & without asking will turn it into one (polyline). Quote
Lee Mac Posted January 8, 2009 Posted January 8, 2009 Just a quick one: (defun c:pj (/ ss1) (setq varlist (list "cmdecho" "peditaccept") oldvars (mapcar 'getvar varlist) ) ;_ end setq (mapcar 'setvar varlist (list 0 1)) (setq ss1 (ssget)) (if (> (sslength ss1) 1) (progn (vl-cmdf "_pedit" "_M" ss1 "" "J" "0" "") (princ (strcat "\n" (itoa (sslength ss1)) " Lines Converted. ")) ) ;_ end progn (progn (vl-cmdf "_pedit" ss1 "") (princ (strcat "\n" (itoa (sslength ss1)) " Line Converted. ")) ) ;_ end progn ) ;_ end if (mapcar 'setvar varlist oldvars) (princ) ) ;_ end defun Quote
ReMark Posted January 8, 2009 Posted January 8, 2009 That's a lot of code for such a straight-forward task. Couldn't it be accomplished with a one line macro? Just curious. Quote
Lee Mac Posted January 8, 2009 Posted January 8, 2009 I accounted for if the user only picks one entity also, and so two statements are needed instead of one... also, I have to set the variable values at start and end. A minor update: (defun c:pj (/ varlist oldvars ss1) (setq varlist (list "cmdecho" "peditaccept") oldvars (mapcar 'getvar varlist) ) ;_ end setq (mapcar 'setvar varlist (list 0 1)) (setq ss1 (ssget '((0 . "LINE")))) (if (> (sslength ss1) 1) (progn (vl-cmdf "_pedit" "_M" ss1 "" "J" "0" "") (princ (strcat "\n" (itoa (sslength ss1)) " Lines Converted. ")) ) ;_ end progn (progn (vl-cmdf "_pedit" ss1 "") (princ (strcat "\n" (itoa (sslength ss1)) " Line Converted. ")) ) ;_ end progn ) ;_ end if (mapcar 'setvar varlist oldvars) (princ) ) ;_ end defun Forgot to localise some variables and added a filter list. 1 Quote
rkmcswain Posted January 8, 2009 Posted January 8, 2009 That's a lot of code for such a straight-forward task. Couldn't it be accomplished with a one line macro? Just curious. Almost... :-) (if (zerop (getvar "PEDITACCEPT")) (command "._PEDIT" "_M" (ssget) "" "_Y" "") (command "._PEDIT" "_M" (ssget) "" "") ) Quote
Lee Mac Posted January 8, 2009 Posted January 8, 2009 Haha, nice one McSwain, but doesn't allow for single ent... Quote
wizman Posted January 8, 2009 Posted January 8, 2009 is that express? yes lee, its one of those express tools...:-) Quote
MR MAN Posted January 8, 2009 Author Posted January 8, 2009 What About This Simple Lisp Is There Any Error On It I Try It And It Work Fine. I Make One For Single Line And Other For Multi Lines Any Advise. LTP.LSP L1.LSP Quote
Lee Mac Posted January 8, 2009 Posted January 8, 2009 Yes, that would work, although, with the multiple lines, you may want to add the "Join" in the pedit command if you want all the lines to be one polyline. But remember to add a fuzz distance. Quote
rkmcswain Posted January 8, 2009 Posted January 8, 2009 there is also mpedit I'm not sure why MPEDIT is even still in ET. PEDIT made it obsolete about 10 years ago when it was modified to accept multiple entities in r2000, maybe r2000i... but doesn't allow for single ent... How so? It works here on any number of entities, including one. Quote
Lee Mac Posted January 8, 2009 Posted January 8, 2009 How so? It works here on any number of entities, including one. McSwain, you have my sincerest apologies. I automatically assumed (to assume is to make an ASS of U & ME) that "PEDIT" "M", [Multiple] needs a selection of more than one entity... without even checking it out for myself... school-boy error. Quote
titashtalukdar Posted January 16, 2009 Posted January 16, 2009 I am new to This Forum, But I think a better option would be to use BPOLY command, but ofcourse it is for a closed periphery... But on the other way round, u can trim tht end, Quote
Lee Mac Posted January 16, 2009 Posted January 16, 2009 Welcome to CADTutor titashtalukdar, Hope you like it here. Thanks for your suggestion, but I think BPoly would only work with Polylines and Regions? Quote
bagulhodoido Posted January 21, 2009 Posted January 21, 2009 Is there any way to just keep drawing a polyline you stopped for some reason? Like, from this specific grip I will keep drawing the polyline considering a new line will be added starting from that grip but still connected to the whole polyline itself. Quote
lpseifert Posted January 21, 2009 Posted January 21, 2009 Try this, thanks to an unknown author PLC.lsp Quote
bagulhodoido Posted January 22, 2009 Posted January 22, 2009 Yeah, almost it, the issue is that the new lines don't become part of the original polyline. Which end up doing the same as if I started a new polyline wih the regular pline command. (: 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.