Lee Mac Posted January 22, 2009 Posted January 22, 2009 I have just tried the LISP, and find that once completed, the extra lines form part of the whole polyline... The LISP contains: (if (and pt (wcmatch (cdadr (entget (entlast))) "*POLYLINE*")) (command "_.pedit" ename "j" (entlast) "" ""))) Which joins the newly created polyline with the existing one. Quote
bagulhodoido Posted January 22, 2009 Posted January 22, 2009 I don't get it, why doesn't it work for me than? I have tried again, It makes a whole new polyline... o.O Quote
lpseifert Posted January 22, 2009 Posted January 22, 2009 Works fine on my machine (joins to original polyline). Quote
bagulhodoido Posted January 22, 2009 Posted January 22, 2009 ----> Width is 0.00; error: no function definition: VLAX-CURVE-GETSTARTPOINT Suddenly, somehow this /\ started to happen... o.O what would that be? Quote
lpseifert Posted January 22, 2009 Posted January 22, 2009 Either add this to the beginning of the code or to your acaddoc.lsp file (vl-load-com) Quote
Lee Mac Posted January 22, 2009 Posted January 22, 2009 Ahh yes make sure that the Visual LISP console is loaded (vl-load-com). Either add it to the ACADDOC.lsp file, or at the start of the LISP itself. As for the new polyline being created. - I have no idea - I am not sure really what could go wrong in such a routine, its such a simple routine. Quote
bagulhodoido Posted January 22, 2009 Posted January 22, 2009 After the (vl-load-com) placed in the beggining of the lisp this started to happen. Select source polyline: Width is 0*Cancel* ; error: Function cancelled OBS.: on the previous error the command didn't even worked, now it works, I draw the polyline and everything it just bugs in the end, causing the polylines to be splitted, maybe the first time I had this same error prompt and I didn't saw it, which would be making the polylines be splitted. ----edit--- My acad version is 2009 btw Quote
bagulhodoido Posted January 22, 2009 Posted January 22, 2009 OUCH! I kept pressing ESC to stop drawing the polyline, I pressed enter, and TCHARAM! IT WORKS! 8D... don't flame my stupidity x) Quote
Lee Mac Posted January 22, 2009 Posted January 22, 2009 Haha, I see your mistake... maybe you can get away with pressing esc with in-built ACAD commands, but custom LISPs are a bit more "fragile" I would recommend setting up a "right-click" customisation, so you can right-click to signal enter and thus exit the command, - makes things much easier. Quote
bagulhodoido Posted January 22, 2009 Posted January 22, 2009 I'm just so used to the ESC pressing, it's involuntary heheh... I got one hand in the mouse the other one in the left upper corner of the keyboard, my thumb just goes around the keyboard and press the shortcuts while my pinky insanely press ESC ESC ESC ESC on every action. Quote
therealjd Posted March 7, 2016 Posted March 7, 2016 Lee, Thanks for the code. Was browsing the forum and this was exactly what i was looking for! Cheers Jd 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. Quote
Lee Mac Posted March 7, 2016 Posted March 7, 2016 You're welcome! - Here are some newer versions: Polyline Programs Quote
baih0000 Posted October 25, 2016 Posted October 25, 2016 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 Hello Lee Mac... What is the name of this command? Is it a lisp? Quote
ReMark Posted October 25, 2016 Posted October 25, 2016 baih: That would be "pj" which stands for Polyline Join. It is one of three lisp routines combined into one master routine that is included in Lee's PolyToolsV1-0.lsp. The other two are Polyline Close (pc) and Polyline Width (pw). Quote
Lee Mac Posted October 25, 2016 Posted October 25, 2016 baih: That would be "pj" which stands for Polyline Join. It is one of three lisp routines combined into one master routine that is included in Lee's PolyToolsV1-0.lsp. The other two are Polyline Close (pc) and Polyline Width (pw). Thanks for responding in my absence ReMark @baih0000, Please refer to the link I posted here. Quote
baih0000 Posted October 31, 2016 Posted October 31, 2016 Okay thank you... Hope that you can figure out a visual lisp for multi-stretch lines... If you have it, kindly introduce me a link to your art-work... Thanks once again... Quote
dexus Posted April 24 Posted April 24 All the functions that use PEdit -> Multiple -> Join could (in my opinion) be improved by setting the fuzz to 0.0 in the code. Because if you just press enter "" after "_J" the previously used fuzz is used, which might give an undesired effect. An example of what can happen is shown in the image below. So just replace the "" after "_J" with "0.0", and the fuzz is always reset to 0: (command "_.pedit" "_m" ss "" "_j" "0.0" "") 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.