Jump to content

Start Zeiss Inspect 2023 Addon with parameter


Recommended Posts

when use follow CMD to start addon in ZI2023,

my code like follow:

- Without parameters :( it works)
C:\Program Files\Zeiss\INSPECT\2023\bin\start_gom.exe atos -eval gom.script.userscript.STL__AutoZ()
 
- With parameters : ( I don't know how to get the parameters info in my addon scripts)
C:\Program Files\Zeiss\INSPECT\2023\bin\start_gom.exe atos -eval gom.script.userscript.STL__AutoZ()(parameters={'variable_1':'valeur_1','variable_2':'valeur_2'})

can anybody show me the code on how to get parameters in my addon

thanks

Hi,

you can access the variables you defined as parameters, i.e. in your case 'variable_1' and 'variable_2', directly.

Example (script_with_parameters.py):

import gom

DIALOG=gom.script.sys.create_user_defined_dialog (file='dialog.gdlg')

#
# Event handler function called if anything happens inside of the dialog
#
def dialog_event_handler (widget):
	pass

DIALOG.input1.value = variable_1
DIALOG.input2.value = variable_2
DIALOG.handler = dialog_event_handler

RESULT=gom.script.sys.show_user_defined_dialog (dialog=DIALOG)

 

"C:\Program Files\Zeiss\INSPECT\2023\bin\start_gom.exe" atos -eval "gom.script.userscript.script_with_parameters(parameters={'variable_1':'valeur_1','variable_2':'valeur_2'})"

will result in

image.png.87e9c76bdac53ef9c89bfd1fa06083b3.png

(Please note: I used a dialog for demonstration, because I noticed that using print() would not show any output.)

Edited
  • 2 weeks later...
×
×
  • Create New...