Nice examples Jed.
Your macros are interactive and time saving, which can prove useful in many situations.
I don't consider my example a general solution. It is more of an eye opener, to see how some functions can be used. This type of automation requires us to be very creative.
From experience, most of the time, I have to code a new macro for a new project. It is very situational, but as you said, it can save us thousands of hours. Very often, I have a huge project that would take me a week or two of tedious work. By automating parts of it, I can reduce the data extraction time by 5X or more. 4 to 6 hours to build the macro, plus 1 -2 hours to finish the job manually, instead of 40h or more of repetitive tasks.
I sometimes develop macros for my customers, and most of the time they don't want the macro to be interactive: they want that magic button that does everything and they just need to wait until it is done. If you shut down all the windows refresh options in Polyworks, it is possible to extract hundreds of features within a few seconds. It takes more time to develop the macro, but it pays off if there are many features to extract.
I once had to inspect a bunch of structural steel I beams forming 30 arches aligned along the same path. I created an automation based on calipers and features. The calipers detect the location of the first arch, then a set of features is extracted. The features are built based on the relative estimated distance between each other. Once this is done, the macro looks for the next arch (estimated distance between the arches) and run the calipers again to prepare for the next set of features. At the end, the macro was a one-button script that extracted about 600 features.
The beauty of this is that even if the arches are not perfectly aligned and are not of the same height, you can use the results from the last arch and provide a large enough range with the calipers to perfectly guess the location and size of the next arch without any manual interaction.
I'm also more familiar with doing this sort of thing in IMInspect and those particular macros were actually written for IMSurvey, which doesn't exist anymore, but was basically a limited version of IMInspect.
IMsurvey was almost the same software, they change x-y-z coordinates for North-East-Height just for convenience and removed some functions to make it look "easier".
P.S. I'm glad to see at least one other person on this forum who's comfortable torturing PolyWorks. I've done some horrible horrible things with that macro language, but am happy to say that those horrible things have easily saved me thousands of hours.
Haha, you have no idea how far I went torturing Polyworks. At some point, it looks more like software development than scripting.