Exception from PMAutomation

Exception from PMAutomation

Anonymous
Not applicable
993 Views
6 Replies
Message 1 of 7

Exception from PMAutomation

Anonymous
Not applicable

Hi, 

 

I am trying to use the PowerMill API by using the PMAutomation. However, when I ran the code, I got an exception. 

This is the line of code that throws an exception:

 

PMAutomation powerMill = new PMAutomation(Autodesk.ProductInterface.InstanceReuse.UseExistingInstance);

 

The exception is shown as "Failed to get executable path for PowerMill", and it is under System.Exception namespace.

 

Anybody knows how to solve this exception?

 

Maan Tarng

0 Likes
Accepted solutions (1)
994 Views
6 Replies
Replies (6)
Message 2 of 7

luke.edwards.autodesk
Community Manager
Community Manager

Hi

 

I have seen this most frequently when you are running your application as 32bit and trying to run 64bit PowerMill.  Please ensure you have complied your application as x64.

 

Luke


Luke Edwards
Consulting Services Manager
0 Likes
Message 3 of 7

Anonymous
Not applicable

Hi, Luke,

 

I have set it to x64. 

 

But it sometimes works, and sometimes not. 

 

Is there any other possible causes for this exception?

 

Regards,

 

Maan Tarng

0 Likes
Message 4 of 7

luke.edwards.autodesk
Community Manager
Community Manager
Accepted solution

You will generally get this if your application is running 32 bit.  When you start PowerInspect, it looks up the executable path in the registry.  The values for this are stored in the 64 bit hive, so if you run 32 bit then it doesn't find them.

 

Just double check next time you get the error that your application wasn't running as 32 bit unexpectedly.

 

Luke


Luke Edwards
Consulting Services Manager
0 Likes
Message 5 of 7

Anonymous
Not applicable

Dear Luke,

 

Thanks for your help.

 

Regards,

 

Maan Tarng

0 Likes
Message 6 of 7

TK.421
Advisor
Advisor

Hi @luke.edwards.autodesk ,

 

I'm having this same issue (with PowerShape). I've done the prescribed checks in this thread, making sure everything is x64, and no luck. Any other ideas?

 

thanks!

David


the numbers never lie
0 Likes
Message 7 of 7

TK.421
Advisor
Advisor

Update: I've tried creating a brand new app using the nuget package and I still cannot connect to powershape. I'm using pshape 2021, and it's the only version installed on this computer. I've tried downloading your pinned example and no luck there either...

 

I uninstalled and reinstalled powershape and now it functions properly...

 


the numbers never lie
0 Likes