Jump to content
Developer Wiki and Function Reference Links ×

New options in script parameters...how to use them?


Recommended Posts

I've been making custom scripts and plugins for quite some time.  But, I just noticed, I guess after a 2021 upgrade, that there are new options for script parameters (I assume these didn't exist .  I got excited to see material and texture options, and a symbol definition.  I was hoping these would allow me user-input of textures and symbols.  But, they don't appear to do that.

 

Can anyone explain how these are used, or if they don't actually do anything with point plug-ins unless they're set up a certain way?

 

image.png.edc2fb2436afe7320077b9cf0d815f57.png

Edited by SamIWas
Link to comment
  • SamIWas changed the title to New options in script parameters...how to use them?
  • Vectorworks, Inc Employee

The new parameters are used to store a reference to a resource. They will not be displayed on the OIP.

For example, the Symbol Definition filed will store the name of a symbol and only a symbol. If you try to put other data in the field if will not store the information.

When the symbol name is changed in the Resource manager, the filed will be updated so the object can use the new value.

 

You still need another user interface element to allow the user to select the resource, so these are not simply parameters that you can just drop into the OIP.

 

The other new options work in a similar manner.

  • Like 1
Link to comment
On 7/21/2021 at 9:07 AM, klinzey said:

The new parameters are used to store a reference to a resource. They will not be displayed on the OIP.

For example, the Symbol Definition filed will store the name of a symbol and only a symbol. If you try to put other data in the field if will not store the information.

When the symbol name is changed in the Resource manager, the filed will be updated so the object can use the new value.

 

You still need another user interface element to allow the user to select the resource, so these are not simply parameters that you can just drop into the OIP.

 

The other new options work in a similar manner.

Thanks, Kevin.  Darn...I was really hoping that it was going to put in a symbol selection menu or a texture selection option.  That would be sweeeeeet.

 

I guess the only option for those things is to just type the name into a text box, right?

Edited by SamIWas
Link to comment
  • Vectorworks, Inc Employee
On 7/28/2021 at 6:38 PM, SamIWas said:

Thanks, Kevin.  Darn...I was really hoping that it was going to put in a symbol selection menu or a texture selection option.  That would be sweeeeeet.

 

I guess the only option for those things is to just type the name into a text box, right?

No, you have 2 options.

If you are picking from a list you can create a dynamically populated pop-up and load the pop-up with the names of the appropriate resource.

The preferred way in VS is to use a button and the Resource Browser, you can add a button to the OIP and call vsoButtonGetResource() when the button event is received.

The SDK will allow you to put the resource selector directly in the OIP but that's not available in VS or Python.

Link to comment

Well, there is a way to put a button in the OIP with Marionette (in form of a single node, a network, or a Marionette object). Then there's also the possibility to make a menu command. All these can trigger a dialog to open with a resource browser drop down.

See this for example:

It's not that cut and dry though, since you have to get down in the mud with the dialog builder, which can be a bit of a hassle.

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