Results 1 to 5 of 5

Thread: Setting text style from tool palette

  1. #1
    I could stop if I wanted to
    Join Date
    2011-09
    Posts
    308
    Login to Give a bone
    0

    Default Setting text style from tool palette

    Hi gang,

    I've got the following code in one of my tool palette icons:

    Code:
    (command "-style" "MVVA 1-8 Bold" "swissk.ttf" "A" "Y" "No" "0.125" "1" "0" "N" "N" "_setvar" "textstyle" "MVVA 1-8 Bold") _Mtext
    It does not set the newly created text style as current before issuing the MTEXT command and I'm baffled as to why.

    If I paste that code into the command line it works fine.

    And.. actually, if I issue the -STYLE command and create that style at the command line, the last thing the STYLE command reports is "MVVA 1-8 Bold is now the current text style". So I should not even need the whole "_setvar" "textstyle" "MVVA 1-8 Bold" business.

    Halp. (and thanks in advance for your halp)

  2. #2
    I could stop if I wanted to
    Join Date
    2011-09
    Posts
    308
    Login to Give a bone
    0

    Default Re: Setting text style from tool palette

    I have found that setting the "Text Style" menu to anything other than "Use Current" (even setting it to the style I want to use) is the cause of this issue.

    The following settings and code seem to be working.

    txt.jpg

    Code:
    ^C^C(command "-style" "MVVA 1-8" "swissl.ttf" "A" "Y" "No" "0.125" "1" "0" "N" "N" "_setvar" "textstyle" "MVVA 1-8") (initcommand version 2) (setvar "CLAYER" "L-ANNO-TEXT") _Mtext

  3. #3
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Colorado Springs, CO
    Posts
    369
    Login to Give a bone
    0

    Default Re: Setting text style from tool palette

    Just a suggestion...

    Simply create the text as you want it - and then drag an example of it to your palette. No need to create and set the text style each time you want to add some annotations with that setting. Take advantage of the built in tool palette functionality.

  4. #4
    I could stop if I wanted to
    Join Date
    2011-09
    Posts
    308
    Login to Give a bone
    0

    Default Re: Setting text style from tool palette

    Thanks Coloradomrg,

    I think the issue we were running into doing it that way, is that if the style already existed in the current drawing but was improperly configured (non annotative let's say) that method would not update the style, it would just use the current (and incorrect) style to place the text.

    I'll test again though just to make sure I'm not nuts. It's always a possibility.

  5. #5
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Colorado Springs, CO
    Posts
    369
    Login to Give a bone
    0

    Default Re: Setting text style from tool palette

    You could always run a lisp during drawing startup that takes care of the styles, both setting and fixing. In the event that something changes in the future, then it's a matter changing one thing instead of each button that references it.

Similar Threads

  1. Setting up a Dimension style from a script file via a Tool Palette
    By kgodfrey in forum AutoCAD Customization
    Replies: 3
    Last Post: 2013-09-08, 09:10 PM
  2. autocad tips: Setting a system variable on the tool palette
    By fishdigg2 in forum AutoCAD Tips & Tricks
    Replies: 0
    Last Post: 2010-09-26, 04:56 AM
  3. Replies: 3
    Last Post: 2008-10-09, 02:05 PM
  4. Setting more than one tool palette path in a CUI command
    By jpaulsen in forum AutoCAD Customization
    Replies: 3
    Last Post: 2007-09-20, 02:41 PM
  5. text style default in tool palette
    By kknauss in forum ACA General
    Replies: 1
    Last Post: 2005-10-04, 06:28 PM

Tags for this Thread

Posting Permissions

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