I wrote a small script in python to write dxf files out. I want to add this to a button on the ribbon. I got that sorted out and can get my button to appear where I want it. I am having trouble calling the script from the button though.
The API tells me that the button has an OnExecute() event that I should listen for to call my script. I have been searching on how to do that from python but I haven't had any luck. Does anybody know where I should be looking to find an answer?
Solved! Go to Solution.
Solved! by xcrx. See the answer in context.
I have added my solution here http://wikihelp.autodesk.com/Inventor/enu/Community/Third_Party_Tools/the_python_page/Listening_to_Events
I have gotten python listening to event and interacting with them with some help from the win32 mailing list. I can launch the script by itself and it funtions as expected. I am trying to set the script up as an AddIn but I am having trouble.
So far I have registered the script using win32com.server.register. Then I manualing modified the registry entries so it would be asociated with inventor as an addin. The addin now shows up on the addin menu but it does not show loaded. When I load it from that menu nothing happens and it is shown as unloaded when I go back to check it.
I know the code is good and that it is registered with windows correctly because I can call it with VBA and it runs as expected. I have to assume that I don't have something set right in the registry but I haven't been able to find much documentation on how things should be set up. I am getting close to making this work. When I do I will share all my code and do a write up on the wiki so others will know how to proceed.
Access a broad range of knowledge to help get the most out of your products and services.
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.
Upgrading to a 2015 product? Make sure to check these out 1st!