tom_shady Posted October 18, 2006 Share Posted October 18, 2006 i?m using SetRField() to change Parameters of a plug-in-object. How can i provoke the plugin to update ? There must be a undocumentated way with a GetEvent() - Funciton ? see Vectorscript Plug-In Editor -> Object Properties, Script Execution, With Script-Specified Events. How does GetEvent work? Where can i find a Documentation? Thanks Quote Link to comment
Rick Francken Posted October 18, 2006 Share Posted October 18, 2006 Hi Tom, I use SetRField to update Parameters within the custom object, and the Plugin Object seems to update correctly. However, it's the last step I do in the code after all the drawing has been done. Here's what typically might happen.. -Assign the parameter value to a variable using the "variable:= PParameter" form. -Constrain the variable to a min/max range -Apply other calculation rules to the variable value -Draw the object using the value of variable, not PParameter -Update the Parameter value using "SetRField(objectHandle,objectName,ParameterName,Num2StrF(variable))" -Call ResetObject With that sequence you really don't need to work with events. Not much vectorscript documentation is available on events. Most of the information I have found is from crawling through the SDK header files, and reading the Vectorscript Discussion List. I have worked with event enabled objects, and use the "vsoGetEventInfo" function instead of the "GetEvent" function. If you have subscribed to the Vectorscript Discussion list, you can search the archives for "event" and Charles Chandler to find more info on event-enabled objects. Quote Link to comment
Petri Posted October 19, 2006 Share Posted October 19, 2006 How about SetClass(h, GetClass(h)), ? Quote Link to comment
Miguel Barrera Posted October 20, 2006 Share Posted October 20, 2006 PIO's only regenerate when the user changes a parameter on the Object Info palette or the user changes its class. In the code for the PIO, ResetObject is not required because if the code is executing, the pio is resetting (or redrawing) itself already. Only if the pio graphics do not show correctly would I add Redraw, ResetBBox, or ResetOrientation3D at the end. If you are trying to regenerate the pio from another script, then after getting the pio handle (pioHdl), change the parameter(s) with SetRField(pioHdl,pioName,parameterName,parameterStringValue)and then call ResetObject(pioHdl) or SetClass(pioHdl,GetClass(pioHdl)). Note that this only works on VW 10 and after. In VW 9, you had to change the pio class to something else like 'None' and then back to the original class if needed. 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.