Jump to content
Developer Wiki and Function Reference Links Read more... ×
michaelk

Editing text in a parametric object

Recommended Posts

Alright.  Thanks to @Pat Stanford for getting me over the hump of converting a script to a parametric object, I'm behaving like a 10 year old with a $20 bill in a candy store.

 

If my object contains text, how can I get the font chooser?  I've discovered a fun infinite loop way of doing it, but force quitting VW every time the object resets isn't optimal.  

Share this post


Link to post

If your object just needs one font you can simply make it a Font Style Enabled object.

This will enable you to use the standard text menu options to set the font attributes with the object selected.

ObjectVariableBoolean(objHand,800,True);

Share this post


Link to post

Thanks, Kevin.  I was looking for exactly that.  

 

Then I started wondering how to make the whole text attribute window come up:  FormatTextDialog(font, style, size, spacing, leading, hAlign, vAlign, disable);  

 

I know how to do it in a script.  I just don't know how to trigger it in a parametric object. (with out starting an infinite loop 🙂

Share this post


Link to post

If you want to be able to display a dialog from inside a PIO, I think you have to make it Event Enabled (5 times more complicated to script for 10 times more power) and make sure that the dialogs are not in the regeneration loop so they are not triggered on a redraw.

 

I have only done a couple of very simple event enabled scripts. Joshua or others may be better able to help if you actually need that functionality.

Share this post


Link to post

Are you looking for more functionality than choosing the dialog from the text menu? Otherwise, you’ll have to do as Pat says, develop an event enabled plug-in, and add a button that raised the dialog. 

 

If you need different parts of the object to have different text settings, assigning text styles by class is an easy option. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×