Create a command for diameter on dimlinear

Create a command for diameter on dimlinear

aschiaratura1
Explorer Explorer
762 Views
5 Replies
Message 1 of 6

Create a command for diameter on dimlinear

aschiaratura1
Explorer
Explorer

Hello, i need a personalized command for use the Ø before the actual text, but i don't use it in every dimension so i wnt a copy of dimlinear but with the Ø simbol before, how can i do that?

use it like a prefix dosen't work for me.

thanks!!!

0 Likes
Accepted solutions (1)
763 Views
5 Replies
Replies (5)
Message 2 of 6

Kent1Cooper
Consultant
Consultant

@aschiaratura1 wrote:

.... use it like a prefix dosen't work for me. ....


Help us understand that.  What about that doesn't work?  Is it just that you haven't yet figured out how to make it work?

 

You can define a Dimension Style with %%C as a prefix:

Kent1Cooper_0-1715955942697.png

and if needed, define a command that sets that Style current before calling up a DIMLINEAR command:

 

(defun C:YourCommandName ()
  (command "_.dimstyle" "_restore" "YourDimensionStyle" "_.dimlinear")
)

 

Or, you can force it onto the front in a text override, which is just another way of prefixing, e.g.:

 

(defun C:YourCommandName ()
  (command "_.dimlinear" pause pause "_text" "%%C<>")
)

 

which will leave you in the command to place the dimension line location.

 

Or does "doesn't work" mean it violates some requirement or prohibition?  If so, it's hard to imagine what you mean, what the properties of a Dimension object would be that would do what you want without violating it, etc.

Kent Cooper, AIA
0 Likes
Message 3 of 6

aschiaratura1
Explorer
Explorer

Sorry i'm a noob on macros and coding how i can make it work?

my drawing are in 2D but often these are pipes so i need a command like dimlinear but that autoomatically use the prefix Ø on the dimension, because having a second button is easier for my father to use.

 

0 Likes
Message 4 of 6

Kent1Cooper
Consultant
Consultant
Accepted solution

Do you know how to put a command macro into a Tool Palette button?  This is the macro equivalent of the last code suggestion in my previous Reply:

 

^C^C_.dimlinear \\_text %%C<>;

 

P.S.  Do these pipes always and only run in orthogonal directions?  If not, you will sometimes need DIMALIGNED, presumably with PERpendicular object snap on for the second point pick, or DIMROTATED, rather than DIMLINEAR.

 

[BUT if you define a Style with the prefix, you don't need any macro or AutoLisp, provided you're willing to set that Style current first as you would for any other Dimension.]

Kent Cooper, AIA
0 Likes
Message 5 of 6

aschiaratura1
Explorer
Explorer

thank you so much, it works!!!!

what would be the command if the pipes are not ortogonal? cause most of the time they are but in some cases they are tilted!!!

0 Likes
Message 6 of 6

Kent1Cooper
Consultant
Consultant

@aschiaratura1 wrote:

.... what would be the command if the pipes are not ortogonal? ....


I would go with this, which will of course also work on orthogonal ones, so it can be universal:

^C^C_.dimaligned \_per \_text %%C<>;

You could go with DIMROTATED, but it's an extra step to pick something and PERpendicular to something else to set the angle, and then you still have to pick two points.

Kent Cooper, AIA
0 Likes