Results 1 to 8 of 8

Thread: Set text height automatically to the correct height of your dimscale.

  1. #1
    Member
    Join Date
    2006-02
    Posts
    25

    Default Set text height automatically to the correct height of your dimscale.

    Did you ever want the text height to be set to the correct height automatically to a factor of dimscale, the same way that the leader command sets itself to the dimscale factor? How about have the text go to the correct layer while your at it. Read on.

    To accomplish this You will need to make a custom toolbar button(s), or alter the macro command(s) in the toolbar button you have for "Dtext" & "Mtext" with the following macro(s):

    1. For Single line text (Dtext):
    ^C^C-layer;set;A-Notes^C^C_dtext \(*(getvar "dimscale")(getvar "dimtxt"));0;

    -NOTE: The first set of commands sets the layer previous to starting the text command. If you do not want the layer set delete "^C^C-layer;set;A-Notes", or change the layer name to the layer you use for your profession.

    2. For Multiple line text (Mtext):
    ^C^C_textsize;(*(getvar "dimscale")(getvar "dimtxt"));^C^C-layer;set;A_Notes;^C^C_mtext \w;0;

    -NOTE: Again, if you do not want to set the layer delete "^C^C-layer;set;A-Notes", or change the layer name to the layer you use for your profession. Also delete the "\w;0" (but leave the last semicolon) if you do not want mtext automatically set to a width of 0.

    If you set up a toolbar button with these macros, you will be able to left <click> to start the command, then left <click> on the screen for you insertion point and begin typing your text.
    -------------
    OK, what's the big deal, you say?

    If you add up the mouse clicks to accomplish the same thing without this macro you'll see what the big deal is:
    "Dtext" without the macro: 1. <click>, 2. <click> (sets the layer); 3. <click>, 4. <click> (choose dtext and start point); 5. <type in height> 6. <enter>; 7. <enter> (for 0 rotation), 8. <begin typing>. That's 8 steps to typing. With the macro it's <click>, <click>, <type>. 3 steps to typing.

    By the way adding "^C^C-layer;set;A-Notes", {a-notes} standing for your layer name, in front of the "dimlinear" and "qleader" commands is a good strategy for those commands as well.

    Another day I'll post the Mtext steps needed before you can start typing, as a comparison to the above macro.
    -------------
    Alright another day is here. Adding up the mouse clicks and typing interactions to accomplish this with Mtext:
    "Mtext" without macro: 1. <click>, 2. <click> (sets the layer); 3. <click> starts the command, 4. <click> <click> (draws the width); 5. <click> (selects text size box); 6. <type new text height>; 7. <enter> (sets the text height to typed value), 8. <begin typing>. Strangely enough that's also 8 steps to typing.

    Macro wins hands down.

    Another day I'll explore putting these into a simple lisp routine, so those of you who like to type in a command can have that function also.

    Best,
    Peter Kastmiler
    Last edited by kastmiler; 2006-03-14 at 12:58 AM.

  2. #2
    Certifiable AUGI Addict Robert.Hall's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,510

    Default Re: Set text height automatically to the correct height of your dimscale.

    How would I modify this if my dtext needs to be 2.25??
    That would be using .9 x Dimtxt and the dimscale to get:

    1 = 2.25
    .75 = 1.6875
    .5 = 1.125

  3. #3
    Active Member Jordan Truesdell's Avatar
    Join Date
    2003-10
    Location
    Virginia, USA
    Posts
    89

    Default Re: Set text height automatically to the correct height of your dimscale.

    So, does this work only from the toolbar, or can it be coded to work from the command line (sorry, greybeard here)? Also, what about setting the layer back to the previous working layer after the text command is finished?

    I know, you offer help and we just ask for more! I've already put this thread in my "to do" folder, but those extras would make it that much better

  4. #4
    Member
    Join Date
    2006-02
    Posts
    25

    Default Re: Set text height automatically to the correct height of your dimscale.

    Setting the layer back to its original current layer, may be getting into the realm of a lisp routine.

    Perhaps someone more knowledgeable can point out if and how that could be accomplished in a toolbar macro.

    This was specifically intended to work from a toolbar icon.

    Peter Kastmiler

  5. #5
    Member
    Join Date
    2006-02
    Posts
    25

    Default Re: Set text height automatically to the correct height of your dimscale.

    Robert,

    You're a bit over my head with that question. But I'll tell you how that works for me.

    If you use various dimstyles for different scaled dimensions then this works very well.
    It works just like the leader toolbar that sets the text & arrow size to match the scale of text & arrow size from the active dimension style.

    Suppose I have several dimension styles, and my "12-1" dimstyle is active. That dimension style has these settings:
    1. Overall dimscale: 12.00
    2. Text height: 1/8"
    With this dimstyle active the dtext and mtext commands will default to using 1-1/2" text size.

    For 2.25" text size, I would need to have a dimstyle of "24-1" active, with the overall dimscale set to 24, and text height set to 3/32".

    Peter Kastmiler

  6. #6
    Member
    Join Date
    2004-02
    Posts
    8

    Default Re: Set text height automatically to the correct height of your dimscale.

    What if you use paperspace to determine the dimscale? In this case the dimscale is set to 0 and hence can't be used.

    I prefer to have one dim style and use the scale by paperspace option. Keeps things simple. But I love the idea of scaling the text to match the viewport scale.

  7. #7
    I could stop if I wanted to LanceMcHatton's Avatar
    Join Date
    2002-04
    Location
    Las Vegas, NV, USA
    Posts
    287

    Default Re: Set text height automatically to the correct height of your dimscale.

    Quote Originally Posted by Jordan Truesdell
    So, does this work only from the toolbar, or can it be coded to work from the command line (sorry, greybeard here)?
    It can be done but It would have to be turned into a lisp.
    Lance McHatton

    AutoCAD Architecture 2008
    Windows Vista
    I swear, I did not dado that rabbet.

  8. #8
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,055

    Default Re: Set text height automatically to the correct height of your dimscale.

    Quote Originally Posted by craig.65586
    What if you use paperspace to determine the dimscale? In this case the dimscale is set to 0 and hence can't be used.

    I prefer to have one dim style and use the scale by paperspace option. Keeps things simple. But I love the idea of scaling the text to match the viewport scale.
    If you dimension in pspace, don't you also put the rest of your text in pspace?

    Just a "wonder-out-loud".
    John B

    "With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion." - Steven Weinberg.

Similar Threads

  1. Misbehaving wall... correct height not diplayed
    By eirik.kjolsrud in forum ACA General
    Replies: 3
    Last Post: 2009-06-09, 07:55 PM
  2. Work out correct Text Height for Plotted output
    By domonic_20 in forum AutoCAD General
    Replies: 2
    Last Post: 2006-05-05, 08:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •