Jump to content

StringConstant Text Properties


Recommended Posts

Hello. New to LAVA and new to VI Scripting, and I love it!

I can change font attributes of StringConstant labels and captions.I cannot figure out how to change the font of the actual StringConstant text using VI Scripting.

Does someone out there know how to? I have attached an image of my Block Diagram.

post-27024-0-46828900-1333461840_thumb.g

Link to comment

I don't think that property is exposed, so I thought I'd be clever...

post-7534-0-65482400-1333466777_thumb.pn

... but the formatting doesn't follow when changing the control back to a constant. I should have tried it manually first; it doesn't work that way either.

Link to comment

Unfortunately, not everything you can do in the editor has been exposed through scripting, and this is one of the holes. Depending upon what you're trying to script, it might work to have a template VI that has a constant on it that already has the font style you want... instead of creating a new constant and trying to set the font, copy the constant from your template and just set the value. Obviously that won't work if you're trying to set an arbitrary font, but if you have a specific font you want to be able to do, it works.

Link to comment
AQ has mellowed since then and would probably not say the same thing today, but it still is important to be aware of the implications of using type cast.
After I finished crying, I added an autotest to LV's nightly test suite just to make sure if anyone did try to change the private fields of those two classes in a way that they no longer coincidentally lined up, we'd see the crash on our end long before release. So far, so good. No one has felt the need to refactor strings. I still don't recommend it, which is why I was waiting to see if the "copy a constant with the right font" workaround would suffice before mentioning this dark alchemy. :-)
  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.