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.
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.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register