MACRO for pline with linetype and GLOBAL WIDTH

MACRO for pline with linetype and GLOBAL WIDTH

Anonymous
Not applicable
3,212 Views
8 Replies
Message 1 of 9

MACRO for pline with linetype and GLOBAL WIDTH

Anonymous
Not applicable

Hi everyone,

 

Since a couple of days i'm trying to train myself in macro writing in autoCAD.

Now i have a question that i can't get solved whilest looking on the internet.

Is it possible to write a macro that goes as this:

 

- go to a certain layer;

- draw polyline;

- set linetype;

- set color;

- set global width;

 

Thus, i would like to have just ONE button, where i have these commands going in a row.

Also, if anyone have more interesting tutorial websites / videos ..... feel free to share.

Thanks in advance.

Mattias

0 Likes
Accepted solutions (1)
3,213 Views
8 Replies
Replies (8)
Message 2 of 9

ВeekeeCZ
Consultant
Consultant

This is a job for the Tool Palette. Only thing you need to adjust is the PLIDEWID system variable.

Message 3 of 9

Anonymous
Not applicable

Hey, Thanks for the response.

But i actually need several buttons, each with certain global widths & linetypes. I can do that with this command?

Or is it better that i learn LISP for such commands?

I would like to have a button for each track i need to draw (image)

Also, it's very important to me that it's not lineweight that is set, but it really needs to be global width


0 Likes
Message 4 of 9

joselggalan
Advocate
Advocate

You can attach a dwg with the different types ..?

 

0 Likes
Message 5 of 9

Anonymous
Not applicable

Hey there,

 

I'm not sure if i understand what you are saying here. sorry!

0 Likes
Message 6 of 9

ВeekeeCZ
Consultant
Consultant
Accepted solution

Sorry, I've needed to make some testing. See the SCREENCAST

 

No need for LISP. It could be done with the Tool Palettes. Only macro has to be changed to:

 

^C^Cpline;\w;5;5

 

(w = global width)

 

... because otherwise (as I had it before using plinewid) it does not reset the properties to it's previous values... not sure why.

Message 7 of 9

Anonymous
Not applicable

YEY!

THANKS!

0 Likes
Message 8 of 9

joselggalan
Advocate
Advocate

I thought that dewitmattias also needed linetypes, so I asked for more information.

 

regards.

0 Likes
Message 9 of 9

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

....
Is it possible to write a macro that goes as this:

 

- go to a certain layer;

- draw polyline;

- set linetype;

- set color;

- set global width;

 

Thus, i would like to have just ONE button, where i have these commands going in a row.
....


Since that request includes so much more than the macro line in the accepted Solution, I have some questions:  Do the last three items in your list apply to the Polyline to be drawn as the second item?  If so, shouldn't those last three items be set before drawing the Polyline?  Or is the idea to apply those Properties to the Polyline after it's drawn?  Or do the last three apply to the overall drawing settings, independent of the Polyline just drawn?

 

If they are Properties to apply to the Polyline, with the linetype & color as overrides rather than coming from the characteristics of the Layer, then in simplest terms:

^C^C-LAYER S 0 ;CELTYPE HIDDEN CECOLOR 1 PLINEWID 0.5 PLINE

 

Edit all these parts for your particular needs.  The Linetype would need to be already loaded into the drawing, but that limitation can be overcome if necessary.

 

If the idea is to apply those Properties to the Polyline after it's drawn, perhaps so that you don't have to reset any System Variables, then a macro isn't the way to do it, because it can't wait for an unspecified number of User inputs in drawing the Polyline until that is finished, and then go on to change Properties, the way an AutoLisp routine can.  The same problem applies to my suggested macro if you want it to reset the System Variables after you draw the Polyline.  A Lisp routine could be defined that would handle those complications, and a macro could just call that routine, if that will work for you.

Kent Cooper, AIA
0 Likes