Jump to content
Developer Wiki and Function Reference Links Read more... ×
Sign in to follow this  
MaxStudio

Auto Rotate Text When Plugin Object Rotated?

Recommended Posts

I created a plugin object that creates a geometric shape and uses strings to display some text. Unfortunately, if I rotate the plugin object in vectorworks the text rotates as well. This creates major neck cramp issues. Is there a way for me to script the rotation of my text so when I rotate my plugin object my text adjusts itself to always displayed correctly?

Thanks in advance,

Derek

Share this post


Link to post

You have to rotate the text manually but it's not difficult. Use GetSymRot to get the rotation of the plug-in. Rotate the text by the opposite (negative) of the rotation value. Make sure "reset on rotate" is enabled in the plug-ins properties in the plug-in editor.

Query again if you need more specific instructions.

-Josh

Share this post


Link to post

Hi Josh,

Beginner with no experience in Vectorscript

Can you explain that in layman's terms? Plug-in object = Symbol?

I'm trying to make Symbols of electrical fixtures with its Fixture Types designation (text) attached to Record Format. Can I make the text rotate with the symbols?

Thanks!

Share this post


Link to post

A symbol draws its geometry from its symbol definition, which is a resource. It's really analogous to a rubber stamp or tracing a template.

A plug-in object gets its geometry from a script. The script can read data from the Object Info palette -- each field is called a parameter. PIOs can range from fairly simple to quite complex.

In order to rotate text so it is always horizontal, you would need to make a PIO inserts a symbol, reads its own rotation, creates the text, then rotates the text in the oposite direction. There are various levels of complexity for retrieving the text value, from using a parameter field (easy) to getting a record attached to the symbol definition (slightly harder).

If you're interested in creating your own plug-in with VectorScript, I recommend first looking up a basic introduction to Pascal, the language on which it is based. Note, this not the more modern Object Pascal.

Next, take a look at the help application's VectorScript Language guide.

Finally, take advantage of the reference materials on developer.vectorworks.net.

-Josh

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
Sign in to follow this  

 

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.

×