Jump to content

I would like to change the name of the saved files and exported PDF from a Scanbox system with Kiosk


---
 Share

Recommended Posts

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

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

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

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

 Share

×
×
  • Create New...