[Li...] Posted June 17 Share Posted June 17 Hello, does anyone know what parameters should be in the gom.interactive.sys.export_script function? Thank you for your help Link to comment Share on other sites More sharing options...
[Ma...] Posted June 18 Share Posted June 18 Hi, you can run print(gom.interactive.sys.export_script.__doc__) from an App, which results in the following (in ZEISS INSPECT 2025): sys.export_script (Export Script...) - Export Script Parameters: Name | Description | Type | Optional ---------------------------------------------------------------------------- file | file name of the created script archive | Tom::Parse::File | No name | qualified name of the script to export | QString | No However, I'm not sure how this works. What do you want to achieve? Link to comment Share on other sites More sharing options...
[Ma...] Posted June 18 Share Posted June 18 Example: import gom method_script_export_path = "C:/temp/methodscript.py" # The qualified name contains the App's UUID name = ":user.338124d1-8053-4b34-b95e-0ec3a84bc5dd.scripts.scripttest" gom.script.sys.export_script(file=method_script_export_path, name=name) Note: In this example, gom.script.sys.export_script() is used (not gom.interactive.sys.export_script)) Link to comment Share on other sites More sharing options...
[Li...] Posted June 18 Author Share Posted June 18 thank you very much Link to comment Share on other sites More sharing options...
[Li...] Posted July 3 Author Share Posted July 3 Hi, script_export_path = "C:/V4-mer3d/Technologie/Data/scripts/Rozpracovane/sss.py" name = "81d6d575-9c08-4428-9526-8820faa1523d" I can't figure out the correct format for name. gom.script.sys.export_script(file=script_export_path, name=name) name = "c76824b1-53c5-4f20-8208-61b314e3590d" name = ":user.c76824b1-53c5-4f20-8208-61b314e3590d.scripts.sss" name = ":lsefranek.c76824b1-53c5-4f20-8208-61b314e3590d.scripts.sss" Cannod find the script with the name ...... Link to comment Share on other sites More sharing options...
[Ma...] Posted July 3 Share Posted July 3 Hi, the correct format is name = ":user.<app_uuid>.scripts.sss" with <app_uuid> from the element "uuid" in the file metainfo.json (not the script's UUID from the script properties. Best regards, Matthias Link to comment Share on other sites More sharing options...
[Li...] Posted September 11 Author Share Posted September 11 (edited) Hi, thanks for the answer, but I still can't do it. Edited September 11 Link to comment Share on other sites More sharing options...
[Ma...] Posted September 11 Share Posted September 11 Hi Please sign in to view this username. , the angular brackets in '<app_uuid>' were meant to indicate a placeholder, i.e. you have to omit them when using an actual app_uuid: name_ = ":user.05dcedce-830b-461d-a70d-b20087c97873.scripts.zkouska" Best regards, Matthias 1 Link to comment Share on other sites More sharing options...
[Li...] Posted September 12 Author Share Posted September 12 Thanks, I tried that, it doesn't work Best regards, Libor Link to comment Share on other sites More sharing options...
[Li...] Posted September 12 Author Share Posted September 12 I tried too gom.script.sys.import_script. but i don't know the format QVariantList Link to comment Share on other sites More sharing options...
[Ma...] Posted September 15 Share Posted September 15 Please sign in to view this username. Could you please give a more detailed description on how gom.script.sys.export_script() failed? Link to comment Share on other sites More sharing options...
[Ma...] Posted September 15 Share Posted September 15 (edited) Hi, QVariantList is mapped to the list type in Python. Here is a working example for gom.script.sys.import_script(): import gom files = ["C:/temp/scripts/script1.py", "C:/temp/scripts/script2.py"] folder = ":user.2d82775a-4761-48c1-9e2b-c88737518e8d.scripts" replace = True gom.script.sys.import_script(files = files, folder = folder, replace_existing_scripts = replace) gom.script.sys.update_addon_database() Before running: After running: Calling gom.script.sys.update_addon_database() is required to update the App explorer view with the newly imported scripts. Best regards, Matthias Edited September 15 Link to comment Share on other sites More sharing options...
[Li...] Posted September 16 Author Share Posted September 16 Thank you very much, but there is still an error somewhere in that folder, but I don't know where. I'm giving up now, thank you. Best regards, Libor Link to comment Share on other sites More sharing options...
[Ka...] Posted September 16 Share Posted September 16 (edited) Could it be that you want to import the script into a defined "Public folder" - instead of your user folder (normally located in C:\Users\IYOUR_USER_NAME\AppData\Roaming\GOM\.... )? Then try instead of :user (which indicates the "user level") :shared And well, your used Windows user must be able to write/modify files into that defined "public folder"... Edited September 16 Link to comment Share on other sites More sharing options...
[Li...] Posted September 17 Author Share Posted September 17 Link to comment Share on other sites More sharing options...
[Ka...] Posted September 17 Share Posted September 17 I have looked again after I noticed "2023\gom_edited_addons" in your picture above.... The code with :user or :shared works for ZEISS INSPECT 2025, but not for ZEISS INSPECT 2023 - If I try it there, I get the same message. For ZEISS INSPECT 2023, use :done in both cases (for importing scripts into "user" as well as into "public"). And important: the target add-on must be in edit mode - but this should be the case as your image shows "gom_edited_addons" Modified example from above, but for ZEISS INSPECT 2023 And as I assume you want to place the script into a subfolder of the adapted "KioskInterface (Customization)" and not simply direct in the "scripts" folder, I added the subfolder KioskInterface to the folder path in the example (> separate subfolders by "/") import gom files = ["C:/temp/scripts/script1.py", "C:/temp/scripts/script2.py"] folder = ":done.2d82775a-4761-48c1-9e2b-c88737518e8d.scripts/KioskInterface" replace = True gom.script.sys.import_script(files = files, folder = folder, replace_existing_scripts = replace) gom.script.sys.update_addon_database() 2 Link to comment Share on other sites More sharing options...
[Li...] Posted September 18 Author Share Posted September 18 Thank you very much, it works. 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