Diesel in a menu macro question

Discussion in 'AutoCAD' started by Gordon Price, Sep 29, 2004.

  1. Gordon Price

    Gordon Price Guest

    I am trying to create a menu macro (to use in a Tool Palette) that will set
    the value of text size to 3/32 X Dimscale, then run the Mtext command. What
    I have is:
    ^C^C_textsize;$(*, $(getvar,dimscale),$(/,3,32));_mtext
    However, this gives all sorts of wierd text size results, and never runs the
    Mtext command. Can anyone point me in the right direction?

    Thanks,
    Gordon
     
    Gordon Price, Sep 29, 2004
    #1
  2. If it needs to be Diesel, I can't help you, but if AutoLisp will do, this
    should work:

    ^C^C_textsize (/ (* (getvar "dimscale") 3) 32) _mtext

    One thing that would cause different text size results would be if you have
    text styles defined with fixed heights, and if one of those is the current
    style when you pick the macro. Those would override the _textsize system
    variable. You could add language to set the _textstyle variable to
    something with a "zero" height in the style definition. Or if you define a
    style with 3/32 x dimscale as a fixed height, you could set _textstyle to
    that instead of bothering with _textsize at all.

    Kent Cooper, AIA
     
    Kent Cooper, AIA, Sep 29, 2004
    #2
  3. Gordon Price

    Tom Smith Guest

    Kent, you need a decimal on one of the numbers to avoid integer division: (/
    3 32) = 0. Use 3.0 or 32.0 instead.
     
    Tom Smith, Sep 29, 2004
    #3
  4. Gordon Price

    mataeux Guest

    dont you need "$M=" ?
    i.e.
    C^C_textsize;$M=$(*, $(getvar,dimscale),$(/,3,32));_mtext
     
    mataeux, Sep 29, 2004
    #4
  5. Good point. I find I often slip up about watching the distinction between
    real and integer numbers.

    Kent Cooper, AIA


    ...
     
    Kent Cooper, AIA, Sep 29, 2004
    #5
  6. Gordon Price

    Gordon Price Guest

    THANKS! I went a step further to
    ^C^C_mtext \_H;$M=$(*, $(getvar,dimscale),$(/,3,32));_L;_E;1X

    Now my text size is set in the Tool, AND I get Exactly 1X spacing by
    default. Slick!

    Gordon
     
    Gordon Price, Sep 29, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.