Inventor Customization

Reply
Contributor
xcrx
Posts: 15
Registered: ‎08-25-2010
Message 1 of 3 (402 Views)
Accepted Solution

Listening to Events(Python)

402 Views, 2 Replies
06-21-2012 05:49 AM

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?

Contributor
xcrx
Posts: 15
Registered: ‎08-25-2010
Message 2 of 3 (365 Views)

Re: Listening to Events(Python)

06-27-2012 09:53 AM in reply to: xcrx

Update:


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.

Contributor
xcrx
Posts: 15
Registered: ‎08-25-2010
Message 3 of 3 (347 Views)

Re: Listening to Events(Python)

07-06-2012 03:59 AM in reply to: xcrx
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.