Text Height in Modemacro

Text Height in Modemacro

richie_hodgson
Collaborator Collaborator
439 Views
3 Replies
Message 1 of 4

Text Height in Modemacro

richie_hodgson
Collaborator
Collaborator

Hi something is resetting my text height in the textstyle and I cant seem to find what it is, is there a way I can get the text height for a specific textstyle "S25" for this example and report it in the modemacro so I can keep a track of when it changes? currently my modemacro is as follows

 

(setvar "modemacro"
  (strcat
   "Dimscale =  $(getvar,dimscale)       LTscale = $(getvar,ltscale)        Dimstyle = $(getvar,dimstyle)        Autosave = $(getenv, AutomaticSaveMinutes)"
  )

 

Any help will be great

Richie
0 Likes
440 Views
3 Replies
Replies (3)
Message 2 of 4

_Tharwat
Advisor
Advisor

You can add what you are looking for , but it won't be updated if the text height of that specific Text STyle 's height is changed .

 

(setvar
  "modemacro"
  (strcat
    (if (tblobjname "STYLE" "S25")
      (strcat
        "Text Height = "
        (rtos (cdr (assoc 40 (entget (tblobjname "STYLE" "S25"))))
              2))
      "")
    " Dimscale = $(getvar,dimscale) LTscale = $(getvar,ltscale) Dimstyle = $(getvar,dimstyle) Autosave = $(getenv, AutomaticSaveMinutes)"))

 

Message 3 of 4

Kent1Cooper
Consultant
Consultant

@richie_hodgson wrote:

Hi something is resetting my text height in the textstyle and I cant seem to find what it is, is there a way I can get the text height for a specific textstyle "S25" for this example and report it in the modemacro so I can keep a track of when it changes? ....


I think the reason Diesel expressions are used for MODEMACRO settings, rather than AutoLisp functions, is because they do update in the display when a value is changed.  Try this, which should show the current text height, though not the height of any specific Style [except when it's current]:

 

(setvar "modemacro"
  (strcat
   "Dimscale =  $(getvar,dimscale)   LTscale = $(getvar,ltscale)   Dimstyle = $(getvar,dimstyle)   Autosave = $(getenv, AutomaticSaveMinutes)   TextHt = $(rtos,$(getvar,textsize))"
  )

)

 

You could add a similar expression to show what the current Style is.  If something is changing the height assigned to that Style when it's not current, and without also making it current, the above won't change the display when that happens.  If that's what's needed, I'm not familiar enough with Diesel to construct the expression to do it [equivalent to _Tharwat's Lisp derivation], but I imagine it's possible.

Kent Cooper, AIA
0 Likes
Message 4 of 4

scot-65
Advisor
Advisor
What the OP is looking for cannot be done in a conventional manner.

I have not tried this, but I can make an educated guess that it will work:
Set up a command reactor to tract all commands.
When triggered, grab the DFX code of that particular style and stuff it in one of the userR# keys [as a string]. (cdr (assoc 40 (tblsearch "style" "s25")))
Update modemacro to read this userR# key.

After all, these user keys were initially designed for these type of uses...

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes