[Kl...] Posted November 9, 2021 Share Posted November 9, 2021 (edited) 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 November 9, 2021 Link to comment Share on other sites More sharing options...
[Er...] Posted November 9, 2021 Share Posted November 9, 2021 (edited) 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 November 9, 2021 Link to comment Share on other sites More sharing options...
[Kl...] Posted November 10, 2021 Author Share Posted November 10, 2021 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? 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 More sharing options...
[Ad...] Posted November 10, 2021 Share Posted November 10, 2021 1. Change: gom.interactive.report.export_pdf to: gom.script.report.export_pdf Link to comment Share on other sites More sharing options...
[Kl...] Posted November 11, 2021 Author Share Posted November 11, 2021 Hi Adam Thank you for feedback ?? 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