Jump to content
Developer Wiki and Function Reference Links ×

Referencing global orientation in a Plug-in Object script


Arshan

Recommended Posts

Hi All,

 

I'm fairly new to Vectorscript (and Vectorworks in general) so please let me know if I've missed something obvious in the documentation.

 

I've created a Linear plug-ing object and it was great that Vectorworks let's me do all the drawing in a local coordinate space without worrying about rotation.

However, I am now looking to have the script scale the drawn object with respect to the global coordinate system. Is there a way to use the plug-in object's Vectorscript to do any of the following:

 

1. Access the "Rotation" value in the object instance's Object Info Palette?

2. Transform the object relative to the global coordinate system from within it's Vectorscript?

3. Any other way to access any info about the object instance's relationship to the global space?

 

I'm happy to use whatever info I can get to do the necessary calculations, just need some way to get info about the objects position.

 

Thanks in advance!

-Arshan

Link to comment
  • Vectorworks, Inc Employee

Hi, Arshan,

 

You are certainly correct that it is crucial for a plug-in object to know something about its environment, not just its own local coordinate system.

 

There is a crucial call, GetCustomObjectInfo() that gets a handle to the container of the current executing plug-in object. For experienced plug-in developers, it is usually the first or second call in the Main() routine of a plug-in. It returns:

  • The PIO record name;
  • A handle to the PIO parameter record;
  • A handle to the PIO object (container) itself; and
  • A handle to the wall (if any) that the PIO might be inserted in.

With these handles, you can do things like find out where the PIO is using e.g. GetSymLoc() and the PIO's rotation using GetSymRot(). (Don't worry about the fact that these two calls say "Sym" instead of "PIO". They will work.)

 

I recommend making http://developer.vectorworks.net/index.php/VS:Function_Reference one of the default tabs on your browser if you're going to start using VectorScript or Python to develop plug-ins.

 

Best of luck, and let us hear!

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