Jump to content

"Export script" Export to a specified drive


---
 Share

Recommended Posts

Hi

I need a little help with a script that can export measuremenreport (PDF) to a specified drive (eg d:/report) and where the file name is the same as project name, and the project name changes depending on which program is executed in the kiosk.

today I use this function, but the problem is that both program and PDF are stored in the same place.
______________________________________________________________________________________________________________
"CustomPatches.py"

# call of the original function to export ginspect and pdf
Evaluate.EvaluationAnalysis.original__export_results (result)

(project_name, export_path) = Evaluate.Evaluate.export_path_info ()
if not os.path.exists (export_path):
os.makedirs (export_path)
_______________________________________________________________________________________________________

"Kiosk Interface_settings.cfg"

[General Settings / Data Storage]
# SavePath specifies the directory where all files
# created by the Kiosk Interface should be stored
SavePath = d:/report

_____________________________________________________________________________________________________

Edited
Link to comment
Share on other sites

Hallo!

Versuch´s mal damit. Ist allerdings ein Script.

import gom

name = gom.app.project.reports['report'].get ('project_name')
#print(name) zur kontrolle
filename = str("D:/Reports/")+(name)+(".pdf") # Laufwerk und Ordner dementsprechend anpassen
#print (filename) zur Kontrolle 

gom.interactive.report.export_pdf (
	export_all_reports=True, 
	file=(filename), 
	jpeg_quality_in_percent=90, 
	max_dpi=150, 
	reports=[gom.app.project.reports['report'].pages['page 1']])

Grüße

Edited
Link to comment
Share on other sites

Hi Erik

Thanks for the script ?

I have two questions I hope you can help me with

1. when I run the script I get this dialog box

Is it possible to approve (ok) it automatically?

1217107916_Dialogbox.PNG.cea81a75400e8a573d092664cc0b050a.PNG

 

2. If there is no folder with similar project name (file name) like the one the scrip is trying to save, is it then possible to get the script to make a new folder?

something like this: os.makedirs( export_path ) 

Link to comment
Share on other sites

 Share

×
×
  • Create New...