def execute(): global file, dialog_id, plugin_handle # check if Lighting Device plugin existing plugin_handle = vs.GetObject(PLUGIN_NAME) device_list = [] vs.ForEachObject(lambda h: device_list.append(h), "(PON='Lighting Device')") if device_list: # create dialog from external file dialog_id = CreateDialog() if vs.RunLayoutDialog(dialog_id, dialog_handler) == kOK: # get platform type for difference file directory style err, dir_path = vs.GetFolder('Select a Folder') file_name, _ = os.path.splitext(vs.GetFName()) file_name = file_name + '.csv' if err == 0: # create file with open(dir_path + file_name, 'w') as file: # main procedure for write data for criteria in cCriteria: vs.ForEachObject(do_it, criteria) vs.AlrtDialog('File: \n' + file_name + ' \n\nCreated in:\n' + dir_path) else: vs.AlrtDialog('Lighting Device not found')
def create_dialog(): global dialog_id dialog_id = vs.CreateLayout('Change Fixture Class', False, 'Apply', 'Cancel') vs.CreateStaticText(dialog_id, 4, 'Lighting-Type-', -1) vs.CreateEditText(dialog_id, 6, new_class, 20) vs.SetFirstLayoutItem(dialog_id, 4) vs.SetRightItem(dialog_id, 4, 6, 0, 0) return vs.RunLayoutDialog(dialog_id, dialog_handler)
def RunDialog(dlgData): # make a copy of the dialog data # so the dialog will edit the copy global dialogData #dialogData = DialogData() #dialogData.operationValue = dlgData.operationValue #dialogData.operationValue1 = dlgData.operationValue1 dialogData = copy.copy(dlgData) global dialog dialog = ui.dlg.CreateDialog() result = False if vs.RunLayoutDialog(dialog, DialogHandler) == ui.dlg.kOK: result = True return result
vs.AlignItemEdge( dialog, kFixtureNamePopup, kRight, 1, kShift ) vs.AlignItemEdge( dialog, kFixtureNumberPopup, kRight, 1, kShift ) vs.AlignItemEdge( dialog, kDmxUniversePopup, kRight, 1, kShift ) vs.AlignItemEdge( dialog, kDmxAddressPopup, kRight, 1, kShift ) # set help strings cnt = 1 while ( cnt <= 32 ): vs.SetHelpText( dialog, cnt, GetHelpStr(cnt) ) cnt += 1 return dialog # Sample dialog handler # Uncomment this code if you want to display the dialog ''' def DialogHandler(item, data): pass dlg = CreateDialog() vs.RunLayoutDialog( dlg, DialogHandler ) ''' # XML defintion of the layout # # <BEGIN_XML> #<?xml version="1.0" encoding="UTF-8" standalone="no" ?> # <DialogBuilder> # # <LayoutData> # <Name>dlg</Name>
def Dialog(handle): Constants.h = handle; Constants.dialogId = CreateDialog() vs.RunLayoutDialog(Constants.dialogId,DialogHandler)
def __init__(self, parameters: PictureParameters): # Widget IDs ################################################################################################################ self.kWidgetID_nameGroup = 10 self.kWidgetID_pictureNameLabel = 11 self.kWidgetID_pictureName = 12 self.kWidgetID_createSymbol = 13 self.kWidgetID_imageGroup = 20 self.kWidgetID_withImage = 21 self.kWidgetID_imageWidthLabel = 23 self.kWidgetID_imageWidth = 24 self.kWidgetID_imageHeightLabel = 25 self.kWidgetID_imageHeight = 26 self.kWidgetID_imagePositionLabel = 27 self.kWidgetID_imagePosition = 28 self.kWidgetID_imageTextureLabel = 29 self.kWidgetID_imageTexture = 30 self.kWidgetID_imageEditButton = 31 self.kWidgetID_frameGroup = 40 self.kWidgetID_withFrame = 41 self.kWidgetID_frameWidthLabel = 43 self.kWidgetID_frameWidth = 44 self.kWidgetID_frameHeightLabel = 45 self.kWidgetID_frameHeight = 46 self.kWidgetID_frameThicknessLabel = 47 self.kWidgetID_frameThickness = 48 self.kWidgetID_frameDepthLabel = 49 self.kWidgetID_frameDepth = 50 self.kWidgetID_frameClassLabel = 51 self.kWidgetID_frameClass = 52 self.kWidgetID_frameTextureScaleLabel = 53 self.kWidgetID_frameTextureScale = 54 self.kWidgetID_frameTextureRotationLabel = 55 self.kWidgetID_frameTextureRotation = 56 self.kWidgetID_matboardGroup = 70 self.kWidgetID_withMatboard = 71 self.kWidgetID_windowWidthLabel = 97 self.kWidgetID_windowWidth = 98 self.kWidgetID_windowHeightLabel = 99 self.kWidgetID_windowHeight = 100 self.kWidgetID_matboardPositionLabel = 73 self.kWidgetID_matboardPosition = 74 self.kWidgetID_matboardClassLabel = 75 self.kWidgetID_matboardClass = 76 self.kWidgetID_matboardTextureScaleLabel = 77 self.kWidgetID_matboardTextureScale = 78 self.kWidgetID_matboardTextureRotatLabel = 79 self.kWidgetID_matboardTextureRotat = 80 self.kWidgetID_glassGroup = 90 self.kWidgetID_withGlass = 91 self.kWidgetID_glassPositionLabel = 93 self.kWidgetID_glassPosition = 94 self.kWidgetID_glassClassLabel = 95 self.kWidgetID_glassClass = 96 # last id = 100 # Dialog settings ################################################################################################################ self.parameters = parameters # Run the dialog ################################################################################################################ self.dialog = vs.CreateLayout("Create Picture", True, "OK", "Cancel") self.dialog_layout() self.result = vs.RunLayoutDialog(self.dialog, self.dialog_handler)