This is my first post and I am not trying to be confusing.
Is it possible to activate a Python script through the the PRE and POST actions of a MenuScript customization?
I would like to do "something" before and after the "save" button(s).
The documentation is also a bit confusing about the matter: https://docs.plm.automation.siemens.com/tdoc/nx/10/nx_api/#uid:index_menuscript:exercises_exercise_i...
Here, we do two separate modifications in two separate files and then save them with the same name and on the same place ... since the File menu is not application specific, do I need the first part of this code?
EDIT UG_GATEWAY_MAIN_MENUBAR MODIFY CASCADE_BUTTON UG_FILE MENU_FILES my_modeling_mods.men END_OF_MODIFY EDIT UG_GATEWAY_MAIN_MENUBAR MODIFY BUTTON UG_FILE_SAVE_PART ACTIONS/PRE test.py END_OF_MODIFY
No, you do not need the first part. You do need to be sure that your .men file has a version statement.
I tested with this .men file, and it worked as expected:
Be sure that your .men file is in a valid "startup" folder, and that test.py is in a valid "application" folder.
You can also use the Block UI styler to generater a custom dialog box and python file
Developer--> Block UI styler
Click on the "code generation" tab and choose Python as your language. You should now have a .dlx file and an associated .py file