Jump to content
Developer Wiki and Function Reference Links ×

GetEvent() - update plug-in objects via script


tom_shady

Recommended Posts

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

Link to comment

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.

Link to comment

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.

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