Learn Everything There is to Know About the Macro Script Editor in Polyworks

And how you can finally succeed at it.

  • angle-right
    You may be stuck with a blank page and don't know where to start. 
  • angle-right
    Learning this very "niche" programming language and software can be time-intensive.
  • angle-right
    You may have a great idea for an automation or an application, but you don't have access to the resources to make it possible in time.

Hi, I'm Jean-Simon, a long-time expert in Polyworks, and the

CEO of FRAS Solutions.  I'm here to help.

What is Polyworks, and Why Use the Macro Script Editor?

Polyworks is a suite of software programs focused mostly on 3D metrology. In a nutshell, you can import 3D datasets from any professionnal 3D scanner and extract the information you want to get from the data.

It is by a fair margin the most powerful measurement solution for 3D scan data. What makes Polyworks unique is that in each module of the software suite (inspection, modeling, surveying, etc.) it is possible to write a program or a script that can automate anything you want to do in the software.

If you are serious about automation, you can develop a complete software solution that drives Polyworks in the background, so that you don't have to code any advanced geometric function and can rely on a certified piece of software trusted by thousands of users in the automotive and aerospace industry.

But why not just use free geometric libraries in any popular programming language (Pyhton, C++, etc.) ?

Short answer: time.

Polyworks is a big shortcut to develop 3D solutions, and the time saved is worth the license fee. Moreover, think about any unanticipated challenge that can pop up when you need to code core mathematical functions. Polyworks is trusted by thousands of users, and most of the hard work is already done for us. It just needs to be implemented.

Is Polyworks a Good Option for You?

Of course, there is an optimal tool for any situation, and the macro script editor must be viewed like that: a tool. There are some situations where it is better to use a more conventional approach. For example, if your program needs to do matrix operations on the 3D data, then it is probably a better idea to look for a programming language like MATLAB or Python, which will fully support those calculations.

The Pros

The Fastest Time to Market

This one is indisputable. Developing a solution in Polyworks is many times faster than with high-level programming languages like Python. Inside Polyworks, you can test ideas and sequences of operation without any programming knowledge. Once the sequence is proven to work (which can usually be done within a day), you already have a traced path to the success of your automation.

A Safe and Predictable Outcome

Any function you use is already rigorously tested by thousands of users. In addition, at any step during the development, it is extremely easy to visualize intermediate results in the viewer, which means that you can identify problems the second they happen. 

A Great Viewer

During the development phase and the support phase, visualization is an underestimated concept. The capability to understand very quickly what happens is very powerful, because bugs that could take many hours to fix in another environment can be solved in minutes.

The Cons

It is an uncommon path

There are not many programmers with experience in Polyworks. There is also a scarcity of easy-to-digest tutorials.

You Need a License

If you are aiming to replicate your solution many times or intent to sell it to your customers, the cost for the licenses could make you hesitate. It really depends about how much you value your time and the convenience of Polyworks, compared to the total value it will bring to you or to your customer.

Limited to What It Is Best At

Polyworks is mainly focused on 3D geometric solving. There are so many things it can do. But of course, if the 3D data needs to be crunched by big mathematics, there are better options. Let's not forget that the language used is a scripting language, so developping complex functions in Polyworks is less efficient than in a compiled language.

However, the SDK (Software Development Kit) allows you to use COM objects. It means that it is possible to develop a software in a popular language that will drive Polyworks, allowing you to get the best of both world. It is common practice to develop an hybrid solution relying on Polyworks for all geometric operations. The results are then transfered to the main software module for the final touch.

*If you are still not sure which working environment is best for you, this guide may help:

How to Automate Measurements of 3D Scanned Data

Is it Safe and Reliable to Develop an Automated Solution in Polyworks?


But of course you probably want me to elaborate a bit more on this.

- The company developping the software, Innovmetric, has been around for 25 years. They have been growing every year and they are not going down anytime soon.

- Their main market is the automotive and the aerospace industry. The toolbox has been rigorously tested and improved for many years already (close to 25 years) by people who take this seriously.

- It doesn't crash. Actually, it happens, but it is quite rare. It happened to me only once during the past 3 years, and I was shocked when it happened. 

- 100% backward compatibility. When they change or improve functions, they make sure that the old code works with the newer versions by respecting the previous behavior. 

So, the answer is yes, it is safe and reliable.

My Story: The First Time I Had to Develop an Automation in Polyworks

It was about 10 years ago, and it was far from perfect. I was working as an application engineer at that time, and one of our customer wanted to fully automate the 3D scanning and the measurements of wood planks. They wanted to do hundreds of them in a single day, so it had to be fast and stable.

It took me almost 2 months to develop the solution. I was in charge of automating the measurements done in the inspection program and another team was responsible for the physical automation of the 3D scanners on a mechanized track.

At that time, I had a few years of experience with Polyworks, but not much with the scripting part of the software. The project seemed simple at first: extract the length, the width and the thickness, then quantify any curve in any direction along the plank. A piece of cake, right? What can go wrong with something as simple as a plank?

It ended up being a lot of struggling - The planks arrived fast on the rack and their position was different everytime. To make things worse, their size and shape could change a lot during the same sequence, making it impossible to use a template, like we normally do when inspecting with a CAD file.

Consequently, I had to implement a safety measure to make sure the alignment was right. It was a serie of iterative measurements from different points of view. Think like if you are wearing a blindfold and have to tell where the plank is only by probing the plank with your hands. This had to be programmed to deal with the random nature of the project.

As we continued to test the solution, new problems appeared. Sometimes, there was just not enough data, but those planks had IDs, so we needed to make sure that IDs match in the report even when these things happened.

After multiple trials and revisions of the macro script, I was proud to finally deliver the solution to our customer. It was a lot of learning. I remember that it took us more time than expected because of the difficulties that we didn't see at first. 

But today, when I think about this story, I feel sorry for what this customer went through and what we delivered. If I had to do the same project today, with what I know today, it would probably take me a week or two to complete, and the result would be much better than what took me 2 months to do.

In conclusion, I learned the hard way. Not because it made sense, but because there was no other way to do it at that time. I suggest you don't do the same. Don't repeat my mistakes. There are better options today.

What Are the Resources to Guarantee Success with the Macro Script Editor?

If you read that far, then you are probably looking for help with the macro script editor. Whether you want to learn the language or hire a programmer, you will find the information you need on this page.

1. Free Resources for Self-Training

There are a few free resources. Even tough this is not the most efficient way to learn, I understand that some people need to learn on a tight budget.

Reference Guides Provided by Innovmetric 

The company behind Polyworks provides a lot of documentation about the functions and how to use the editor. They are located under Help -> Reference Guides -> from the top menu.

The first guide is named "Macro Scripts". It is a general introduction to the scripting language, and every beginner should start here. The second, and most useful guide is named "Commands". It is a list of all available commands that can be opened in your web browser. The best way to use it is to search for a keyword until you find what you need. The third, but also an essential guide, is the "IMInspect" guide. This guide is huge (about 3000 pages)! It covers all the geometric function in the inspection module. It helps you understand the behavior of the functions you want to use and their different parameters.

Finally, there is the "Polyworks SDK". This guide is useful if you are developing a plug-in, or if you want to use the COM objects and integrate your solution with another programming language outside of Polyworks.

Online Videos and Webinars 

The content available online is very limited, and while I found a few videos, only one was worth sharing:

If you are aware of any other educational video covering the macro script language and want to contribute, just drop me an e-mail and I will add it to this list.

Get Access to Online Tutorials

We plan to relase a few of them in the future, but we don't have a specific schedule for the release.

If you want to stay up-to-date, subscribe to our list and we will e-mail you when one is ready.

*My personal take on self-training: this is still learning the hard way. From the moment something doesn't work as expected, you will need to search for answers, and google won't be your friend this time.

2. Professional Training

There is no better way to learn than being taught by an expert. It turns out that this is a service we provide. The training sessions are private and we recommend a maximum of 3 persons per training session. This is because the training is highly personalized, and it is important to keep a good pace during the training.

This is not a generic training. We highly recommend that you bring a project or specific problems that you want to solve to get the most value from the training. It is often possible to get a full return value from the work done during the training sessions.

*My personal take on the professional training: I recommend this training to people with already some experience with Polyworks. Learning Polyworks is very rewarding, but the learning curve is slow, since it has so many functionalities. Innovmetric (the company behind Polyworks) offers free generic training at their office, if you can afford to travel to Quebec City. If you don't want to, we can also provide that type of training on-site. 

3. Turn-Key Development Service

If you really need to secure your project, you can opt for a turn-key development service. You will need to describe your project with as much detail as possible. Then, together, we clearly define inputs and outputs. Inputs are the type of 3D data, the 3D scanner selected, and information that the user must provide before the automation sequence. Outputs are the expected results, and how they are presented to the user.

Usually, actions are required from your part during the project. You may have to provide 3D samples that will be used to test the application. The more you have the better. This is how we can ensure that the application is stable and work as intended. You may also have to test it before it is finished, and provide recommendations and guidance for the final version.

*My personal take on the development service: Conventional use of Polyworks and macro development require a different mindset and are normally executed by different persons. This is why in many cases, the development service is the best option. 

“Timing Is the Most Important Factor to Success”

This is why great ideas should be executed as fast as possible. Don't wait until it's too late. 

Get Professional Services

We support companies by developping professional 3D solutions for them. This is something we have been doing for many years, and we keep getting better at it.

It is fast.

It is safe.

It is confidential.

  • 1
    Get it done in time: make sure that your project will be a success, in time.
  • 2
    Secure your project: by hiring experts, you will avoid many traps and mistakes.
  • 3
    Confidential: we have a non-disclosure policy and all work is executed under NDAs.

Apply Now and Receive Free Advice

No obligation from your part. Here's what we will share for free:

  • The feasibility of your project and which working environment is best (based on our personal experience).
  • The estimated cost and turnaround time for your project.
Jean-Simon Fraser

Founder of FRAS Solutions

About Me

I started my career as an engineer for a 3D scanner manufacturer, back in 2008. During those years, I kept pushing the limits of what can be automated in Polyworks, until we reached a point where we had people doing it full-time, because it brought so much value to the business.

100% Satisfaction Guarantee

We only want happy customers. You are fully protected by our 100% Satisfaction-Guarantee. If we can't deliver, you don't have to pay. 

Frequently Asked Questions

What if my project is confidential?

I still don't know if Polyworks is the right choice for what I want to do. What can I do?

How do you support companies outside of Canada?

Do I need to be on a maintenance contract with Innovmetric for this to work?

Is it possible hide the source code so that my application can't be copied?

​​What is the average lead time for an automation project in Polyworks?