Jump to content

Use the result of a dialog box


Recommended Posts


I'm looking for a solution to collect a value entered in a dialog box to use it in another line. Despite my searches in the forum and my knowledge of python not being good enough, I didn't find the solution. I can create a dialog box but not use its result.

Concretely, I want to display a dialog box which asks to enter the temperature of the room and a dialog box which asks for the reference of the part to be scanned and insert its values later in lines.

Concerning the requested temperature, I'd like to use it in the "measurement_temperature=20" line and replace the 20, for example, with the value entered in the dialog box:

gom.script.atos.set_project_settings (
    measurement_temperature= 20, 

Concerning the request for the part reference, I'd like to use it to export the STL and save the project automatically and change its name in the folder path by the reference entered in the dialog box. Here are the commands affected:

NAME TO CHANGE in red is the name I want to change from the value in the dialog box

gom.script.sys.save_project_as (file_name='C:/Users/user/AFFAIRES/AF231037/2 - Mesures/GOM/W1000720498-01/NAME TO CHANGE.ginspect')

gom.script.sys.export_stl (
    elements=gom.ElementSelection ({'category': ['key', 'elements', 'part', gom.app.project.parts['Pièce'], 'explorer_category', 'actual_part']}), 
    file='C:/Users/user/AFFAIRES/AF231037/4 - Exports/MY/W1000720498_01/NAME TO CHANGE.stl', 

Attached you can find part of the script I'd like to use.

THANKS ! I hope I was clear enough!

Script test.txt

Link to comment
Share on other sites

Thanks! I missed this part !

So I had to use print(RESULT) and print(RESULT.whatisneeded) and use RESULT.whatisneeded where I need it and It works.

Link to comment
Share on other sites


  • Create New...