[Kr...] Posted January 3, 2024 Share Posted January 3, 2024 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 Link to comment https://qualityforum.zeiss.com/topic/3520-start-zeiss-inspect-2023-addon-with-parameter/ Share on other sites More sharing options...
[Ma...] Posted January 4, 2024 Share Posted January 4, 2024 (edited) 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 (Please note: I used a dialog for demonstration, because I noticed that using print() would not show any output.) Edited January 4, 2024 Link to comment https://qualityforum.zeiss.com/topic/3520-start-zeiss-inspect-2023-addon-with-parameter/#findComment-9924 Share on other sites More sharing options...
[Kr...] Posted January 15, 2024 Author Share Posted January 15, 2024 It's done thank you Link to comment https://qualityforum.zeiss.com/topic/3520-start-zeiss-inspect-2023-addon-with-parameter/#findComment-10057 Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in