Josh, Custom menu now working now just trying to get the OIP button. I am rewriting the Vectorlab Events demo3 from Vectorscript to Python so I understand how events work. @JBenghiat Thank you so much fo all of your help, not sure I would even have made it this far without your help!!
Still having an issue with my event based scripts. The code below compiles and executes without errors however the code in the reset block never runs, so I never get my rect object. I am VERY new to this so I am sure there is a rookie mistake somewhere, . Also if you see other things in the code structure that I can improve let me know, just learning python so I am sure the code has room to improve.
import vs
def run():
#Declare constants
kObjOnInitXProperties = 5
kResetEventID = 3
kObjXPropPreventWallInsertion = 7
kObjXPropHasUIOverride = 8
kWidgetButton = 12
kObjOnObjectUIButtonHit = 35
buttonID_1 = 1234
thisDoesNothing = 0
#this call gets the event ID and button if applicable
theEvent, theButton = vs.vsoGetEventInfo()
#If its the property inialization event - Do this
if theEvent == kObjOnInitXProperties:
vs.SetObjPropVS(kObjXPropPreventWallInsertion, True)
vs.SetObjPropVS(kObjXPropHasUIOverride, True)
vs.vsoInsertAllParams()
sourceFieldNumber = 1
displayString = 'My Great Field Name'
vs.vsoAppendParamWidget(sourceFieldNumber, displayString, thisDoesNothing);
displayString = 'My Great Button';
vs.vsoAppendWidget(kWidgetButton, buttonID_1, displayString, thisDoesNothing);
#If The button is pressed detect which button and Do this
elif theEvent == kObjOnObjectUIButtonHit:
if theButton == buttonID_1:
vs.AlrtDialog('Custom Button Dialog')
#Where the standard PIO scripting goes to generate the object when reset us called
elif theEvent == kResetEventID:
vs.Rect(0, 0, 1, 1)
run()