Adjusting Text height based on Viewport Scale

Posted on 2007-10-03
Last Modified: 2013-12-04
We are setting our dimension styles with the option "Scale dimension to layout". So whenever the viewport scale is changed a simple "Update" command readjusts the dimension scale to suit the vieport scale.

But for the case of simple text, everytime the viewport scale is changed the new text height or text scale has to be calculated and then applied to selected text.

Is it possible to have a simple command like "Update" which does the calculation as well as modification as in the case of dimension objects?

Question by:Saqib Husain, Syed
    LVL 7

    Expert Comment

    You can use command SPACETRANS to create a bogus string of text with the purpose of quickly finding the text height needed in Model Space to have the desired Text height in Paper Space:

    Convert Text Height Between Model Space and Paper Space
    The SPACETRANS command converts distances between model space units and paper space units. By using SPACETRANS transparently, you can provide commands with distance entries relative to another space. For example, you may want to create a text object in model space that matches the height of other text in a layout. From model space, you could enter

    Command: text

    Specify start point of text or [Justify/Style]: 1,3

    Specify height <0.375>: 'spacetrans

    >>Specify paper space distance <1.000>: 3/8

    Resuming TEXT command

    Specify height <0.375>: 1.173

    When the command is complete, a text object is created in model space with a height of 1.173, which appears as 3/8 when viewed from a layout.

    Then use SCALETEXT using the Model Space height found with SPACETRANS.

    Change the Scale of Multiple Text Objects
    A drawing may contain hundreds of text objects that need to be scaled, and it would be tedious to scale them individually. Use SCALETEXT to change the scale of one or more text objects such as text, multiline text, and attributes. You can specify a relative scale factor or an absolute text height, or you can scale selected text to match the height of existing text. Each text object is scaled using the same scale factor, and it maintains its current location.

    Quick and dirty, if you dont want to resort to macros.
    LVL 43

    Author Comment

    by:Saqib Husain, Syed
    This does not help much. It is an additional step for entering text. Maybe a macro is what I would need.

    I shall need some help with respect to event trapping. What events should I trap. I have tried Begincommand and Endcommand but these trappers do not recognise scaling done by scrolling the mouse wheel. How can that event be trapped?

    LVL 7

    Expert Comment

    Heh, that why i added "Quick and dirty, if you dont want to resort to macros." ;o)
    Probably they could be combined in one customised command, but i'm not skillful with creating those sorry :o(

    Its still only 2 commands, SPACETRANS to quicly find the height required to yield the desired height in PS (instead of calculating it yourself), then SCALETEXT to apply it globally.

    Good luck
    LVL 10

    Expert Comment

    you got this yet?
    what version of autocad are you running?
    my quick and dirty/lazy way to do this would be to create a qleader with the new scale and then do a mass match properties an all the text. eitherway you do it it seems to me you will have to do some moving around of the text to get it to look right with the new scale.
    If you have 2008 I think there is a new "annotative" option that you can assign for different scales.
    LVL 11

    Accepted Solution

    This could be done fairly easily with Lisp, VBA, etc. It's just a matter of how you want it to function. Will the utility just rip through the entire drawing donig it all? What if the Text is viewable in more than one viewport with different scales? Which does it use? Do you just do one viewport at a time? Select the text you want to do this to?  Where does it resize from? The insert point? Center?

    You could also place the text in Paper.

    Honestly this isn't worth doing IMO. AutoCAD 2008 allows you to create Annotative text styles that are designed for just this purpose.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Following a number of instances of re-installing Solidworks I thought that it may be a  good idea to detail the procedure that I follow each time to ensure a good stable install. Backup: Backup your system.  It goes without saying that this i…
    Our company has proprietary drawing files that we do not give to our customers for final documentation. Our customers now require that we give them these drawings. They understand that they are proprietary and do not require them to be in AutoCAD bu…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now