PowerMill API - How to solve "Autodesk.ProductInterface.PowerMILL.PMAutomation" problem when accessing "powermill.Options.Tool.Database.FileName"

PowerMill API - How to solve "Autodesk.ProductInterface.PowerMILL.PMAutomation" problem when accessing "powermill.Options.Tool.Database.FileName"

patrick_lam
Participant Participant
1,174 Views
8 Replies
Message 1 of 9

PowerMill API - How to solve "Autodesk.ProductInterface.PowerMILL.PMAutomation" problem when accessing "powermill.Options.Tool.Database.FileName"

patrick_lam
Participant
Participant

Dear Sir,

 

Could you please advise how solve the compiling problem of code involving parameter "powermill.Options.Tool.Database.FileName"? The compiling problem message is:

- Error 4 'Options' is not a member of 'Autodesk.ProductInterface.PowerMILL.PMAutomation'. ...

 

Best Regards, Patrick.

0 Likes
Accepted solutions (1)
1,175 Views
8 Replies
Replies (8)
Message 2 of 9

luke.edwards.autodesk
Community Manager
Community Manager

Hi, I'm confused about what you refer to. Can you share more information on the code? Are you compiling you own version of the API?


Luke Edwards
Consulting Services Manager
0 Likes
Message 3 of 9

patrick_lam
Participant
Participant

Dear Luke,

Sorry for confusing you.

I am writing a PowerMill Apps by API and woud like to read and edit the PowerMill parameter.

During the build of the solution, Visual Studio prompts the error message.

Best Regards, Patrick.

0 Likes
Message 4 of 9

luke.edwards.autodesk
Community Manager
Community Manager
Can you share a screenshot of your code?

Luke Edwards
Consulting Services Manager
0 Likes
Message 5 of 9

patrick_lam
Participant
Participant

Here it is:

20230314-01.png

0 Likes
Message 6 of 9

luke.edwards.autodesk
Community Manager
Community Manager

Ok, so that just doesn't exist as a property available through the API. Where did you get the indication that the "Options.Tool.Database.FileName" parameter was something that could be accessed?


Luke Edwards
Consulting Services Manager
0 Likes
Message 7 of 9

patrick_lam
Participant
Participant

By this way:20230314-02.png20230314-03.png

0 Likes
Message 8 of 9

luke.edwards.autodesk
Community Manager
Community Manager
Accepted solution

Ok, so I think the only way you could get that is to do:

powermill.ExecuteEx("print $powerMill.Options.Tool.Database.FileName")

Luke Edwards
Consulting Services Manager
0 Likes
Message 9 of 9

patrick_lam
Participant
Participant
Thanks a lot, Luke.
0 Likes