antant Posted November 26, 2008 Posted November 26, 2008 how should i edit the "^C^C_pedit" macro so that it closes the selected polyline with one hotkey ? thanks in advance Quote
CmdrDuh Posted November 26, 2008 Posted November 26, 2008 ^C^C^C_pedit;\c; i think should do it Quote
antant Posted November 26, 2008 Author Posted November 26, 2008 ^C^C^C_pedit;_c;_x; is what actually works) figured it myself based on your post. BUT, unfortunatelly you cant run _pedit on multiple polylines, so, i'd appreciate if anyone would post a script that closes all of the selected polylines with a single hotkey. (if possible?) =) p.s.: thanx CmdrDuh p.p.s.: i found this forum while googling an autocad macro guide or smth. cant locate it here though) if there is one, please link it) also. if there's a thread explaining "0" and "defpoints" layers, id appreciate a link there too =) Quote
Lee Mac Posted November 26, 2008 Posted November 26, 2008 Dunno if this is of any use to anyone? (defun c:cp (/ ss1) (setvar "cmdecho" 0) (setq ss1 (ssget)) (if (> (sslength ss1) 1) (progn (vl-cmdf "_pedit" "_M" ss1 "" "_C" "") (princ (strcat "\n" (itoa (sslength ss1)) " Polylines Closed. "))) (progn (vl-cmdf "_pedit" ss1 "_C" "") (princ (strcat "\n" (itoa (sslength ss1)) " Polyline Closed. ")))) (setvar "cmdecho" 1) (princ) ) Quote
antant Posted November 27, 2008 Author Posted November 27, 2008 thanx =) i'll try it out as soon as i can edit: yaay, it does exactly what i wanted it to =) thanks again Quote
jcap91163 Posted August 2, 2010 Posted August 2, 2010 as always, works like a charm, many thanks mr. mac Quote
Lee Mac Posted August 2, 2010 Posted August 2, 2010 Another perhaps; (defun c:plc ( / ss ) (vl-load-com) ;; © Lee Mac 2010 (if (setq ss (ssget "_:L" '((0 . "LWPOLYLINE") (70 . 0)))) ( (lambda ( i / e ) (while (setq e (ssname ss (setq i (1+ i)))) (vla-put-Closed (vlax-ename->vla-object e) :vlax-true) ) ) -1 ) ) (princ) ) Quote
alanjt Posted August 3, 2010 Posted August 3, 2010 Lee, don't forget about if the user draws LWPolylines with the PLINEGEN variable set to 1. The 70 code will be 128 for open ones. Quote
Tharwat Posted August 3, 2010 Posted August 3, 2010 Another perhaps; (defun c:plc ( / ss ) (vl-load-com) ;; © Lee Mac 2010 [color="red"](setq plgen (getvar 'plinegen)) (setvar 'plinegen 0)[/color] (if (setq ss (ssget "_:L" '((0 . "LWPOLYLINE") ))) ( (lambda ( i / e ) (while (setq e (ssname ss (setq i (1+ i)))) (vla-put-Closed (vlax-ename->vla-object e) :vlax-true) ) ) -1 ) ) [color="red"](setvar 'plinegen plgen)[/color] (princ) ) Some corrections mr LEE, And it goes very well with in all conditions of PLines ..... Tharwat Quote
lpseifert Posted August 3, 2010 Posted August 3, 2010 the plinegen variable only affects plines as they are created Quote
alanjt Posted August 3, 2010 Posted August 3, 2010 Some corrections mr LEE, And it goes very well with in all conditions of PLines ..... Tharwat All you've done is the state of the PLINEGEN variable. You will accomplish nothing with your changes. Quote
lpseifert Posted August 3, 2010 Posted August 3, 2010 no problem, that's me and that's you. wt??? .... Maybe you ought to let Lee Mac edit Lee Mac's code. Quote
Tharwat Posted August 3, 2010 Posted August 3, 2010 wt??? ....Maybe you ought to let Lee Mac edit Lee Mac's code. Actually nobody needs for any reason to help any one, and if I made a mistake in one of my given codes to any one, would you correct it or .....what ??? We should never hesitate from helping any one ....... That's my opinion. Tharwat Quote
lpseifert Posted August 3, 2010 Posted August 3, 2010 A if I made a mistake in one of my givencodes to any one, would you correct it or .....what ??? Tharwat I wouldn't correct it, I'd start over from scratch. Quote
Tharwat Posted August 3, 2010 Posted August 3, 2010 I wouldn't correct it, I'd start over from scratch. OK, I do respect other's opinions . But for me, I can't see the mistake and keep on watching it without do something since I could. And that's why I said to Alan that's me and that's you. Regards. Quote
alanjt Posted August 3, 2010 Posted August 3, 2010 Not knowing how to isn't the issue here, it's that you are playing a guessing game and submitting something that's completely wrong. This isn't the first time this has occurred. Select, regardless of PLINEGEN: (ssget "_:L" '((0 . "LWPOLYLINE")(-4 . "<OR") (70 . 0) (70 . 128) (-4 . "OR>"))) Quote
Tharwat Posted August 3, 2010 Posted August 3, 2010 OK, No problem at all, this is another way to make it.... Quote
alanjt Posted August 3, 2010 Posted August 3, 2010 OK, No problem at all, this is another way to make it.... No, the above line of code is how you only select open LWPolylines, regardless of LinetypeGeneration. What you had just turned off the PLINEGEN variable and selected all LWPolylines. Quote
chulse Posted August 3, 2010 Posted August 3, 2010 OK, No problem at all, this is another way to make it.... Dude, if you have a question about someone's code, ask. But telling the Gurus they're wrong is just rude... I hate to get into this, but these guys have helped me way too much to not stick up for them... 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.