[Ky...] Posted February 26, 2024 Share Posted February 26, 2024 Hello all, I am trying to modify the name of the project files and the exported PDF from that project. Right now it is jus the date and time that file was created. I would like to use some of the project keywords that the user enters in the Kiosk as well as the Date and Time. How would I do this? Is it native to the custom patch generator? I see a custom export on in that but it doesn't let me choose PDF. Any help is appreciated. Link to comment Share on other sites More sharing options...
[Na...] Posted February 27, 2024 Share Posted February 27, 2024 Hello Kyle, you can edit the name in the custom patch. The keyword can be inserted into the script with F2 or RMB -> insert element value. The name can be constructed with python syntax. # -*- coding: utf-8 -*- import gom keyword = gom.app.project.user_inspector mesh_name = gom.app.project.actual_master gom.script.report.export_pdf ( file='C:/Users/USER/Documents/ZEISS_INSPECT_Sample_Data_2023' + keyword + mesh_name +'.pdf', jpeg_quality_in_percent=90, max_dpi=150, pdfa=True, reports=[gom.app.project.reports['report 5']]) Nanno Link to comment Share on other sites More sharing options...
[Ky...] Posted February 27, 2024 Author Share Posted February 27, 2024 Thank you for the reply Nanno. This is my first time with custom patches. Do I just place this anywhere in the custom patch script? Is this the custom patch under the Kiosk part of scripting? Link to comment Share on other sites More sharing options...
[Ky...] Posted February 28, 2024 Author Share Posted February 28, 2024 Please sign in to view this quote. Please sign in to view this quote. i found how to edit the CustomPatches python script. If i add this script into the CustomPatches script, will it save two PDFs? I was also looking to modify the script to save the project file with identifying information as well. Would i just copy the script from the KioskInterface>Evaluate script that saves the project and add it to this CustomPatches script. This is what i found in the KioskInterface>Evaluate script gom.script.report.export_pdf ( export_all_reports = True, file = os.path.join( export_path, project_name + '.pdf' ), jpeg_quality_in_percent = 100, reports = gom.app.project.reports ) while True: try: gom.script.sys.save_project_as( file_name = os.path.join( export_path, project_name ) ) except Exception as error: res = Globals.DIALOGS.show_errormsg( Globals.LOCALIZATION.msg_save_error_title, Globals.LOCALIZATION.msg_save_error_message, Globals.SETTINGS.SavePath, True ) if res == True: continue break If I just ad my code to the CustomPatches with the extra Keywords in the join function, would that solve my problem? Link to comment Share on other sites More sharing options...
[Na...] Posted February 29, 2024 Share Posted February 29, 2024 Hi Kyle, yes that would solve it 🙂 Link to comment 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