Jump to content
Developer Wiki and Function Reference Links ×

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

Link to comment

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

Link to comment
  • 3 months later...

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!

Link to comment
  • 1 month later...

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

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.
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.

×
×
  • Create New...