Jump to content

Recommended Posts

Posted

how should i edit the "^C^C_pedit" macro so that it closes the selected polyline with one hotkey ?

 

thanks in advance

  • Replies 26
  • Created
  • Last Reply

Top Posters In This Topic

  • Tharwat

    8

  • alanjt

    6

  • Lee Mac

    3

  • antant

    3

Top Posters In This Topic

Posted

^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 =)

Posted

Dunno if this is of any use to anyone? :P

 

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

Posted

thanx =)

i'll try it out as soon as i can

 

edit:

yaay, it does exactly what i wanted it to =)

 

thanks again

  • 1 year later...
Posted

as always, works like a charm, many thanks mr. mac

Posted

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

Posted

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.

Posted
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

Posted

the plinegen variable only affects plines as they are created

Posted
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.
Posted
no problem, that's me and that's you.

wt??? ....

Maybe you ought to let Lee Mac edit Lee Mac's code.

Posted
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

Posted
A if I made a mistake in one of my given

codes to any one, would you correct it or .....what ???

Tharwat

I wouldn't correct it, I'd start over from scratch.

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

Posted

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

Posted
OK, No problem at all, this is another way to make it....8)

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.

Posted
OK, No problem at all, this is another way to make it....8)

 

Dude, if you have a question about someone's code, ask. But telling the Gurus they're wrong is just rude...:glare:

I hate to get into this, but these guys have helped me way too much to not stick up for them...

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