Jump to content

nkunstle

Member
  • Posts

    5
  • Joined

  • Last visited

Reputation

0 Neutral

Personal Information

  • Location
    United States
  1. Thank you Jim W! The new summarized notes are great, I hope that this becomes the standard for the future!!
  2. Facepalm 🤦‍♂️, can't believe I missed that, I think I stared at that code for an hour before I gave up. Anyway thanks for helping me find my solve!
  3. 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()
  4. Thanks for the quick response. Trying to work through creating the custom dialogues, I'll let you know my progress in a few days. Is there a direction you can point me to in order to learn how to insert the button widget in the OIP? Most of the OIP stuff I have done so far are parameters defined by the "Parameters" tab in the "Edit Definition" window.
  5. New to scripting for vectorwork, so apologies if I am asking a simple question... I am scripting a PIO that includes a collection of lights, I want to put a parameter in the OIP that works like the color picker that shows up there when inserting an individual light. Functionally I can do numerical fields to capture the RGB data but without the color picker it's a long processes to get the right color. Is there any way to put a "color" parameter in a python script so that it shows up in the OIP as a color picker button?
×
×
  • Create New...