Jump to content

Automatic linetyps per Macro


Recommended Posts

Hi,

 

I would like to know if it is possible to write macros (buttons) that can draw polylines within a certain layer, linetype, global width, color.

 

Thus, as you can see in the image, if i want to draw an existing cable track, the macro should be some sort as this:

 

go to layer "existing_cable_layer"; draw polyline; global width = 0.18; linetype = A; color = black;

 

- Before this i tried to set a global width on a layer, but this seems to be impossible.

 

i just started a couple a days ago with macro writing so i'm quite a beginner.

What i would like the most is that i can make buttons for each cable / tube track.

 

Thanks in advance!

track_def.jpg

Link to comment
Share on other sites

Welcome to CADTutor Matti. :)

 

There are a bunch of different ways you could do this.

 

One easy way, would be by creating a small block of each one of these, with the WBLOCK command, and putting them all on a custom TOOL PALETTE.

It sounds to me like you are, or should be working on a custom .dwt (template), which includes these layer names, linetypes and properties.

Set the lineweights, linetypes and colors in the layer manager.

 

Yes, these could also become new toolbar buttons, or custom commands, with macros, which would basically just need to set the correct current layer, and start a polyline.

The custom command aliases might be nct, ect, ntt & ett, for instance.

Link to comment
Share on other sites

When in comes to line width doesn't the word "global" imply for the entire drawing? Wouldn't it be better to assign a line weight to each layer?

Link to comment
Share on other sites

Welcome to CADTutor Matti. :)

 

There are a bunch of different ways you could do this.

 

One easy way, would be by creating a small block of each one of these, with the WBLOCK command, and putting them all on a custom TOOL PALETTE.

It sounds to me like you are, or should be working on a custom .dwt (template), which includes these layer names, linetypes and properties.

Set the lineweights, linetypes and colors in the layer manager.

 

Yes, these could also become new toolbar buttons, or custom commands, with macros, which would basically just need to set the correct current layer, and start a polyline.

The custom command aliases might be nct, ect, ntt & ett, for instance.

 

Hey man,

 

Thanks for welcoming!

 

Yes, typical, not long after this post, i found out how to make tool palettes. What a freedom when able to work with those.

 

Still looking forward to create macros though, you will be hearing from me in the future ;).

 

Thanks again!

Link to comment
Share on other sites

When in comes to line width doesn't the word "global" imply for the entire drawing? Wouldn't it be better to assign a line weight to each layer?

 

Correct,

 

excuse me :)

Link to comment
Share on other sites

Why not incorporate everything into your template file. When the job is done purge out unreferenced entitites like linetypes, layers, etc.?

Link to comment
Share on other sites

Why not incorporate everything into your template file. When the job is done purge out unreferenced entitites like linetypes, layers, etc.?

 

This is certainly a good approach.

You could include one of each of these, in your template. :beer:

Link to comment
Share on other sites

Our version of your request we just have this in our template in the 1st layout and copy and paste close to the area we are working in and just use the "layer select" from the layers toolbar. Very simple.

Screen Shot 05-02-17 at 02.01 PM.PNG

Link to comment
Share on other sites

Here is an example of creation.

You can change for yourself.

*^C^C_.-Layer;_Make;existing_cable_layer;;_Color;7;_-Linetype;_Set;"ACAD_ISO02W100";;_Lweight;0.18;_Pline;

And this for the layer

*^C^C_.-Layer;_Make;existing_cable_layer;_Color;7;;_Ltype;"A";;_LWeight;0.18;;;_Color;ByLayer;;;_-Linetype;_Set;ByLayer;;_Lweight;ByLayer;_Pline;

Link to comment
Share on other sites

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