deepImplement Posted November 22, 2019 Share Posted November 22, 2019 Heyo, I tryed to use parameter and strings wich can be added in the Plugin Manager. But i dont get how to use them in the Python Scripts...  The Vectorworks Helpsheet dindt really help to make this clear.  Can someone take my dumbness away and tell my how this System works?😅 Quote Link to comment
PatW Posted November 22, 2019 Share Posted November 22, 2019 The defined params are stored in the ParamRecord which has the name off the ParamObjectType.  First you need to get the param rec name, thats saver than hardcoding it:  http://developer.vectorworks.net/index.php/VS:GetParametricRecord  Put the handle in this function:  http://developer.vectorworks.net/index.php/VS:GetName  At the end you pass the paramObject, the name off the param record and the Fieldname into this function:  http://developer.vectorworks.net/index.php/VS:GetRField   2 Quote Link to comment
Pat Stanford Posted November 22, 2019 Share Posted November 22, 2019 I don't know about PythonScript, but is straight Vectorscript it is much easier. Â Anything that is defined as part of the parameter record can be accessed as a variable in Vectorscript by prepending it with a letter "p". Â So a Parameter of Length_1 would be used as a variable in the script at pLength_1. Â Two tricks to this: 1. The parameter variables are only read at the beginning of the script execution and only written at the end, so you can't use them internally as loop counters or use it to access a change made earlier in the script. If you need that copy the data to a script (instead of parameter) variable, use that during the execution and then save back to the parameter variable at the end of the execution. 2. It means you don't want to start your variables in a PIO with the letter p as they will be assumed to be parameter variables. 2 Quote Link to comment
Peter Vandewalle Posted November 22, 2019 Share Posted November 22, 2019 In Python just use this form: par = vs.Pparametername where par is the value in your python script and parametername is the PIO parameter. 2 Quote Link to comment
JBenghiat Posted November 22, 2019 Share Posted November 22, 2019 vs.GetPluginString() will access the strings in the plug-in definition. http://developer.vectorworks.net/index.php/VS:GetPluginString  You can also access strings and image resources from a VW resource file. See: http://developer.vectorworks.net/index.php/Vectorworks_VWR_Resources Information on how to access via script is at the bottom of the page. 1 Quote Link to comment
Recommended Posts
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.