Jump to content
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

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.

×
×
  • Create New...