Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Plinewid system variable

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
531 Views, 3 Replies

Plinewid system variable

Does anyone in the group know how to edit the command string below so
that I when you hit this tool it will start the Pline command but reset
the Plinewid system variable back to "0" after the user is done drawing
the polyline??

Thanks in advance,

Mark


^C^C-linetype;set;bylayer;;-color;bylayer;-layer;make;E-UNDERGROUND;color;RED;;lt;CENTER;;;PLINE
3 REPLIES 3
Message 2 of 4
Kent1Cooper
in reply to: Anonymous

Not in plain macro language, but macros can contain Lisp expressions.

{code}
^C^C-linetype;set;bylayer;;-color;bylayer;+
-layer;make;E-UNDERGROUND;color;RED;;lt;CENTER;;;+
PLINE +
(while (> (getvar 'cmdactive) 0) (command pause)) +
PLINEWID 0
{code}

That should wait for User input as long as the Pline command is still running, and once it's done, reset PLINEWID to 0.

--
Kent Cooper


MRH wrote...

Does anyone in the group know how to edit the command string below so
that I when you hit this tool it will start the Pline command but reset
the Plinewid system variable back to "0" after the user is done drawing
the polyline??
....
Kent Cooper, AIA
Message 3 of 4
Anonymous
in reply to: Anonymous

Kent,

Thanks so much for getting back to me with a solution. I changed my
macro to this:

^C^C-linetype;set;bylayer;;-color;bylayer;-layer;make;E-UNDERGROUND;color;RED;;lt;CENTER;;;PLINE
(while (> (getvar 'cmdactive) 0) (command pause)) PLINEWID 0;;;

This macro produces the polyline fine, but doesn't return PLINEWID to 0.
I found this in the command history:



Command: PLINE
Specify start point: (while (> (getvar 'cmdactive) 0) (command pause))
PLINEWID
Invalid point.

Specify start point:
Current line-width is 0'-3"
Specify next point or [Arc/Halfwidth/Length/Undo/Width]:
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]:

Command: nil

Can you see from within this text, why this doesn't re-set PLINEWID to 0??

Thanks again for your help,

Mark






1Cooper wrote:
> Not in plain macro language, but macros can contain Lisp expressions.
> {code} ^C^C-linetype;set;bylayer;;-color;bylayer;+
> -layer;make;E-UNDERGROUND;color;RED;;lt;CENTER;;;+ PLINE + (while (>
> (getvar 'cmdactive) 0) (command pause)) + PLINEWID 0 {code} That
> should wait for User input as long as the Pline command is still
> running, and once it's done, reset PLINEWID to 0. -- Kent Cooper MRH
> wrote... Does anyone in the group know how to edit the command string
> below so that I when you hit this tool it will start the Pline command
> but reset the Plinewid system variable back to "0" after the user is
> done drawing the polyline?? ....
Message 4 of 4
Kent1Cooper
in reply to: Anonymous

It's cumbersome to test macros, because of having to include them in a menu, compile the menu and make the new version current, etc., so I'm flying by the seat of my pants, but here's my guess:

Help for the (while) function says it returns the last value of the last expression, which in this case would be the (command pause) thing. If you've just finished drawing a Polyline with it, that returned value would probably be Enter. If that's returned, it's probably what is starting up the PLINE command again, and then the PLINEWID would indeed be invalid to answer the first prompt.

One way you might be able to test it, without changing anything yet, would be to use it, and try hitting the *Escape* key to end the Polyline, rather than Enter. Then I'm guessing the (while) function should return a Cancel, the PLINE command should *not* be recalled, and the PLINEWID reset should work.

If that's what happens, try simply forcing a cancel after the (while) function:

(while (> (getvar 'cmdactive) 0) (command pause)) ^CPLINEWID 0

That should allow you to end the Pline with Enter *or* Escape [or even Close], without getting stuck in a new Pline command afterwards.

--
Kent Cooper
Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost