Discussion: Options to create PowerMILL automation
Hi,
I would like to start a discussion about the different ways one can automate PowerMILL.
Disregarding templates, I can think of four different methods:
1) Using PowerMILL Macro language:
+ integrated inside PowerMILL
+ easy to learn and build up knowledge (from simple macro recording to complex macros)
+ does not need any SDK
+ does not need any installation
+ pretty powerfull programming lanuage
+ access to most parameters
+ works in any active PowerMILL window
- anyone can see the source code
- no GUI for the automation (only Input/Message boxes)
- limited interaction with Windows file system
- no interaction with other applications
- No access to PowerMILL events (activating, creating, deleting, ..., of entities)
2) HTML page with embedded Visual Basic Script or JavaScript
+ no SDK required
+ provides nice GUI (HTML)
+ works inside PowerMILL
+ works with any open PowerMILL window
- harder to learn than PowerMILL macro
- anyone can see the source code
- not very common in PowerMILL user base
- No access to PowerMILL events (activating, creating, deleting, ..., of entities)
3) Visual Basic or C# application
+ Uses official Delcam/Autodesk API
+ Provides DIRECT ACCESS to many parameters and functions
+ Relatively easy to use
+ pmill.Execute and pmill.ExExecute allow sending/receiving standard PowerMILL commands and their responses
+ Code is protected (but sent commands can be seen in PowerMILL shell)
+ Allows EMBEDDING the PowerMILL window inside the VB/C# application window for full integration
- Requires installing API
- Requires Visual Studio (can use the Express/Free edition)
- Only works with the FIRST PowerMILL window: if you open several PowerMILL sessions, you can only connect to the first
- No access to PowerMILL events (activating, creating, deleting, ..., of entities)
4) PowerMILL Plugin
+ Works INSIDE PowerMILL
+ Access to many PowerMILL events (activating, creating, deleting, ..., of entities), upon subscription
+ Fairly easy to distribute
+ Code is protected
+ Works with any open PowerMILL window
- Does not use Delcam/Autodesk API, so most interaction is done through pmill.Execute and pmill.ExExecute commands. At least I don't know how to use the API in this case. Perhaps there is a better way...
- Close to no documentation at all
- Difficult to understand the process of creating the plugin DLL and registering it, if you are not a programmer
- To test/debug you need to restart PowerMILL every single time you recompile the code
I hope this gives everybody a better understanding of the possibilities.
Also, I am interested to get further information about plugins:
- How to use the Autodesk PowerMILL API with plugins? Is that even possible?
- Is there newer documentation on API and Plugins?
- Is there a way to FULLY hide the GUI on PM2018 onwards (the NoGUI option leaves the menu bar visible)
- ...
Hope you guys find this useful. Perhaps I (or anyone) can include examples here for each scenario in the future.
Kind regards,
Vitor