Jump to content

Recommended Posts

Posted

Is There Any Way To Convert Lines To Polylines By Selecting Them ?

Posted

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).

Posted

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

Posted

That's a lot of code for such a straight-forward task. Couldn't it be accomplished with a one line macro? Just curious.

Posted

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. :oops:

  • Thanks 1
Posted
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) "" "")	   
)

Posted
is that express?

 

yes lee, its one of those express tools...:-)

Posted

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

Posted

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. :thumbsup:

Posted
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.

Posted
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.

Posted

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,

Posted

Welcome to CADTutor titashtalukdar, Hope you like it here.

 

Thanks for your suggestion, but I think BPoly would only work with Polylines and Regions?

Posted

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.

Posted

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. (:

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...