Jump to content

Export using currently opened project parameters


---
 Share

Recommended Posts

Hello,

I would like to use the currently opened project parameters like name of the project and path of the project. ( eg.: name: New_project 1; path: C:/Users/.../Desktop )

How can I implement these in my script? This is not in Kiosk just an user-defined script.

 

Best regards,

Máté Tömöri

Link to comment
Share on other sites

The following code may be helpful:

# -*- coding: utf-8 -*-

import gom
import gom_utils
import os


project_file = gom.app.project.project_file

print (project_file)
print (os.path.dirname (project_file))
print (os.path.basename (project_file))

There could be filename and Operating System constellations where this approach wouldn't work, but usually this  approach is sufficient enough.

Hope this helps?!

Regards

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Just an additional comment for more general access to project parameters:

In the script editor hit the F2 key and select "Object group: Project -> project -> ..." in the pop up dialog.
image.png.583a6fcfc7ec4c48833bd0c6c2fb6d06.png

I am quite sure this is what Bernd did to get "gom.app.project.project_file".

Link to comment
Share on other sites

 Share

×
×
  • Create New...