Jump to content

OnInit Event not firing


Recommended Posts

I have an event-based PIO Linear Object that doesn't seem to be firing the OnInit event. I have an AlrtDialog that fires immediately after vsoGetEventInfo function but I never get an event ID of 5. Specifically I don't get it the first time I use the tool after opening VW2023.

 

Any thoughts?

Link to comment

What is the logic flow of your code?

 

-> get_custom_info_ok, plugin_name_internal, plugin_handle, plugin_record_handle, plugin_wallHand = vs.GetCustomObjectInfo()

 

-> if get_custom_info_ok:

<main plugin code functions>

 

-> theEvent, theMessage = vs.vsoGetEventInfo()

set an AlrtDialog for both theEvent, and theMessage and see what you get

 

 

 

Edited by twk
Link to comment
  • 3 weeks later...

The weird thing is another PIO I use the logic is working fine,  This is what I have done to try and figure out what is going on.

this is python Script in the script editor.:

 

import _Gizmo

 

id, button = vs.vsoGetEventInfo()
vs.AlrtDialog(f'Script Editor {id}') #normally I don't make this call here but in the _Gizmo.run after running the vs.GetCustomObjectInfo call
_Gizmo.run(id, button)

 

this is the python Script in "_Gizmo.run":

 

vs.PushAttrs

event.id, event.button = eventID, eventButton

pioName, hPIO, recHand, wallHand = 0, 0, 0, 0

ok, pioName, hPIO, recHand, wallHand = vs.GetCustomObjectInfo(pioName, hPIO, recHand, wallHand)

if ok:

    vs.AlrtDialog(f'Gizmo.run {event.id}')

 

vs.PopAttrs

 

When I exit the VW SciptEditor I get the following alerts:

 

Script Editor 5

Script Editor 3

Gizmo.run 3

 

So it appears the onInit event is not "finishing"

 

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