0% found this document useful (0 votes)
523 views

Geomagic Control X Visual Scripting Tutorial

This document provides a tutorial on using visual scripting in Geomagic Control X. It contains 6 exercises that teach how to run preset scripts, debug scripts, and create new scripts. The first exercise shows how to run a preset script that imports multiple meshes and measures their volume. The second exercise demonstrates debugging the preset script by stepping through it. The third exercise overview describes creating a script using various actions to prepare data, convert it, perform measurements, and output results. It outlines steps to link actions like Leading Parameters, File Search, and Parameter to Data to define file paths and search for files.

Uploaded by

Arturo rojas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
523 views

Geomagic Control X Visual Scripting Tutorial

This document provides a tutorial on using visual scripting in Geomagic Control X. It contains 6 exercises that teach how to run preset scripts, debug scripts, and create new scripts. The first exercise shows how to run a preset script that imports multiple meshes and measures their volume. The second exercise demonstrates debugging the preset script by stepping through it. The third exercise overview describes creating a script using various actions to prepare data, convert it, perform measurements, and output results. It outlines steps to link actions like Leading Parameters, File Search, and Parameter to Data to define file paths and search for files.

Uploaded by

Arturo rojas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 132

Geomagic Control X

Visual Scripting Tutorial


SCRIPTING TUTORIAL

The purpose of this tutorial is to give you an advanced understanding of the Scripting process in Geomagic Control X. By
working through the tutorial procedures, you will learn how to create scripts and run it as automations on Geomagic Control X.

• Measuring Volume of Mesh

In this course, you will learn how to import a mesh and measure its volume.

• Measuring Overall Deviation by using an Inspection Template

In this course, you will learn how to create an inspection template project and inspect overall deviation by replacing
multiple Measured data.
• Measuring Holes

In this course, you will learn how to compare Measured data to CAD data and extract cylinders from hole features.

• Measuring GD&T by using an Inspection Template

In this course, you will learn how to create an inspection template project and inspect GD&T by replacing multiple
Measured data.

• Measuring Deviations at Predefined Positions

In this course, you will learn how to align Measured data to Reference data with RPS and measure deviations at the
predefined positions.

3D Systems, Inc.
MEASURING VOLUME OF MESH
Introduction
This tutorial is intended for users who want to become quickly familiar with Geomagic Control X Visual Scripting.

This step-by-step tutorial will show you what you can accomplish with Visual Scripting in Geomagic Control X. By working
through the tutorial procedures, you will learn how to create scripts and run it as automations on Geomagic Control X.

Data Files
(~<Product Installation Path>\VisualScripting\Sample\Example_01)

• Sample_Scan_01~04.stl – Target Measured Data for measurements

• Example_01.scrpt – Saved Script

The sample data for this tutorial is provided by 3D Systems, Inc. They are the property of 3D Systems, Inc. and are used for
informational purposes only. Other than to identify this software and publication, individuals or organizations purchasing the
software are not entitled to use the sample data without 3D Systems, Inc.’s prior written consent.

3D Systems, Inc.
Overview
What will you understand in this course?
• Visual Scripting User Interface

• Flexibility with the level of automation and its customization

• Increase the productivity of inspection using scripts

What will you learn to do in this course?


• Run the preset script

• Run the preset script in the Debugging mode

• Create a script that imports multiple meshes and measures their volume automatically

What does this course cover?


Three exercises are provided. Proceed to one of the following exercises for more information.

Exercise Introduction

Run Preset Script

You will learn how to run the preset script and get results.

Run Preset Script in the Debugging mode

You will learn how to debug the preset script and walk through the action sequences.

Create a Script

You will learn how to build a script that imports multiple meshes and measures their volume automatically.

3D Systems, Inc.
Exercise
Run the preset script
In this step, you will learn how to run the preset script and get results.

1. Run the Geomagic Control X application by executing a GeomagicControlX.exe file.

Default file location is: C:\Program Files\3D Systems\Geomagic Control X <Version Number>

2. Proceed with one of the followings.

[Run the preset script in Geomagic Control X]

a) On the TOOLS tab, in the Script group, click Open the Script folder.

b) Browse Example_01.scrpt file at the following location and open the file by clicking Open.

Default file location is: <Default Program Installation Path>\VisualScripting\Sample\Example_01

c) Click Start to run the selected script.

d) The Visual Script Editor will open and the selected preset script will run automatically.

[Run the preset script in Visual Scripting Editor]

a) On the TOOLS tab, in the Script group, click Visual Script Editor to open the Visual Script Editor.

b) Click Open or go to File > Open.

c) Browse Example_01.scrpt file from the following location and open the file by clicking Open.

Default file location is: <Default Program Installation Path>\VisualScripting\Sample\Example_01

d) In the Visual Scripting Toolbar, click Start or go to Debug > Start to run the script.

3D Systems, Inc.
3. Check if the script runs without any failures and the results are created.

Run the preset script in the Debugging mode


In this step, you will learn how to debug the preset script and walk through the action sequences.

1. Make sure the “Example_01” script is loaded on the Scripting Canvas and nothing is progressed.

2. Right click on the Leading Parameters action and click Add Breakpoint on the Context Menu.

3. In the Visual Scripting Toolbar, click Start to run the script, or go to Debug > Start.

4. When running the script, it will stop at the defined breakpoint locations for analysis.

5. When a script has stopped at a breakpoint, additional controls will appear in the Toolbar, enabling you to Continue
(to the end of the script or to the next breakpoint), Pause, Stop, or Next Step (jump to the next step [action] of the
script).

6. Click Next Step to continue until you want to analyze.

3D Systems, Inc.
Create a Script - Overview
Geomagic Control X Visual Scripting environment is designed to enable you to easily create scripts. It is based on a visual
interface environment, that enables flexibility with the level of automation and its customization. The created scripts can then
be run either within Geomagic Control X or externally, outside the application.

In this exercise, you will learn how to add actions and create a script. A variety of actions is used for building up a script. For
each step, add the actions to the Scripting Canvas and complete sequence by linking one to another.

For more information on the actions available in the Visual Scripting Editor, refer to User Interface Overview > Geomagic
Control X Visual Scripting in the Help document.

What does this exercise cover?

Steps Introduction

Preparations

The Leading Parameters, Search (File Search), and Converter (Parameter to Data) actions are used for data
preparations.

Data Conversion

The For Each and Converter (ForEach Iterator) actions are used for data conversion.

3D Systems, Inc.
Measurements

The File (New Document), File (Import File), Search (Entity Search By Context), and Measure (Measure Volume)
actions are used for setting up measurements.

Outputs

The Expression and Tools (Export Tabular View) actions are used for setting up outputs.

3D Systems, Inc.
Step 1. Preparations
In this step, the Leading Parameters, Search (File Search), and Converter (Parameter to Data) actions are used. Add the
actions to the Scripting Canvas and complete sequence by linking one to another.

1. On the TOOLS tab, in the Script group, click Visual Script Editor to open the Visual Script Editor.

2. Make sure if there is any unsaved document open in the Visual Script Editor. If yes, click Save or Save As

to save your document and click New or go to File > New to create a new document.

3. In the Action List, under the General Operations menu, double click Leading Parameters, or click and drag it
to the Scripting Canvas.

4. In the Expression input box, type the following two expressions and click Enter. Click Plus icon to add more
expressions. The Leading Parameters is used to define the path of input and output.

3D Systems, Inc.
Expressions 1: sampleFolder=”..\VisualScripting\Sample\Example_01\”

Expressions 2: outputFolder=”C:\TestOutput\Example_01\”

Note: The name of input or output variables can be defined as you desired. The input file path needs to be
pointed to where the target file is located. The out file path can be defined as you desired.

Note: It is recommended to specify the absolute path for input data to avoid any error.

5. In the Action List, under the Geomagic Control X > Search menu, double click Search (File Search), or click
and drag it to the Scripting Canvas.

6. In the Search (File Search), change the File Type to Scan Files.

3D Systems, Inc.
7. In the Action List, under the Geomagic Control X > Converter menu, double click Converter (Parameter to
Data), or click and drag it to the Scripting Canvas. The Converter (Parameter to Data) is used to convert data that
is forwarded from files as parameters to Data that can be used for next actions.

8. To define the desirable execution order, link the actions by adding flow connectors. Click Out-Flow of the Search
(File Search) action and drag to In Flow of the Converter (Parameter to Data) action.

9. The same way as in the previous step, make the actions linked as shown in the image below.

3D Systems, Inc.
10. Select the actions by clicking them while holding the Ctrl key down on your keyboard or drawing a box around the
actions.

11. Right click and click Group on the Context Menu to make them as a group.

12. The selected actions are grouped. Double click the name of the group and change it as you desired.

Note: The output parameter (outputFolder) socket in the Leading Parameters will later be linked to the
input parameter socket in the next Expression.

3D Systems, Inc.
Step 2. Data Conversion
In this step, the For Each and Converter (ForEach Iterator) actions are used. Add the actions to the Scripting Canvas and
complete sequence by linking one to another.

1. In the Action List, under the General Operations menu, double click For Each, or click and drag it to the Scripting
Canvas to add the For Each action. The For Each action is used for loop functionality, where each action in the
input list is run.

2. In the Action List, under the Geomagic Control X > Converter menu, double click Converter (ForEach Iterator),
or click and drag it to the Scripting Canvas, and then drag it into the For Each action. The Converter (ForEach
Iterator) is used to indicate how many iteration runs within the ForEach action.

3D Systems, Inc.
3. Make the Converter (Parameter to Data) and the For Each actions linked as shown in the image below.

3D Systems, Inc.
Step 3. Measurements
In this step, the File (New Document), File (Import File), Search (Entity Search By Context), and Measure (Measure
Volume) actions are used. Add the actions to the Scripting Canvas and complete sequence by linking one to another.

1. In the Action List, under the Geomagic Control X > File menu, double click File (New Document), or click and
drag it to the Scripting Canvas, and then drag it into the For Each action.

3D Systems, Inc.
2. The same way as in the previous step, add File (Import File), Search (Entity Search By Context), and Measure
(Measure Volume) actions and place them into the For Each.

Note: Use the Search Box to search actions in the Action List.

3. In the File (Entity Search By Context) action, change the Context Type to Measured Data.

4. in the Measure (Measure Volume) action, clear the Use Projection Plane option.

3D Systems, Inc.
5. Make them linked as shown in the image below.

Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

Step 4. Outputs
In this step, the Expression and Tools (Export Tabular View) actions are used. Add the actions to the Scripting Canvas and
complete sequence by linking one to another.

1. In the Action List, under the General Operations menu, double click Expression, or click and drag it to the
Scripting Canvas, and then drag it into the For Each action.

3D Systems, Inc.
2. The same way as in the previous step, add Tools (Export Tabular View) action and place it into the For Each.

Note: Use the Search Box to search actions in the Action List.

3. In the Expression, in the Expression input box, type the following two expressions and click Enter. Click Plus
icon to add more expressions.

o Expressions 1: measureName=filenamewithoutextension(valueIn)

o Expressions 2: outFile=outputFolder+”\”+measureName+”_Measure.csv”

Note: The name of input or output variables can be defined as you desired. The output parameter
(outputFolder) socket in the Leading Parameters will later be linked to the input parameter (outputFolder)
socket.

3D Systems, Inc.
Tip: The following functions are available in the Expression action. They can be defined with other
expressions and used for different purposes of functionalities.

Expression Function Description

tostring Converts values to string

Returns the folder name from the specified full path, like
folder
Path.GetDirectoryName .NET Method.

Returns the file name and extension from the specified full path, like
filename
Path.GetFileName .NET Method

Returns the file name without extension from the specified full path, like
filenamewithoutextension
Path.GetFileNameWithoutExtension .NET Method

Returns the extension from the specified full path, like Path.GetExtension .NET
extension
Method

Changes the extension of the specified path, like Path.ChangeExtension(String,


replaceextension
String) .NET Method

Combines folder and file names into a path, like Path.Combine(String,


append
String) .NET Method

4. In the Tools (Export Tabular View) action, change the Feature Type to Measurement.

3D Systems, Inc.
5. Make the added actions linked as shown in the image below.

Note: Make sure that the output parameter (outputFolder) socket in the Leading Parameters is linked to
the input parameter (outputFolder) socket in the Expression.

6. Finally, the script is completed. Right click on the Leading Parameters action and click Add Breakpoint on the
Context Menu.

Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

7. In the Visual Scripting Toolbar, click Start to run the script, or go to Debug > Start to test your script.

8. Click Next Step to continue until you want to analyze.

3D Systems, Inc.
Conclusion
This course is now complete.

You have learned:

• How to run the preset script

• How to run the preset script in the Debugging mode

• How to create a script that imports multiple meshes and measures their volume automatically

3D Systems, Inc.
MEASURING OVERALL DEVIATION BY USING AN
INSPECTION TEMPLATE
Introduction
This tutorial is intended for users who want to become quickly familiar with Geomagic Control X Visual Scripting.

This step-by-step tutorial will show you what you can accomplish with Visual Scripting in Geomagic Control X. By working
through the tutorial procedures, you will learn how to create scripts and run it as automations on Geomagic Control X.

Data Files
(~<Product Installation Path>\VisualScripting\Sample\Example_02)

• Sample_CAD.X_T, Sample_Scan.stl (under Input folder) – Reference and Measured Data for template project

• Sample_Scan_01~03.stl (under TargetMeasuredData folder) – Target Measured Data for measurements

• Example_02.scrpt – Saved Script

The sample data for this tutorial is provided by 3D Systems, Inc. They are the property of 3D Systems, Inc. and are used for
informational purposes only. Other than to identify this software and publication, individuals or organizations purchasing the
software are not entitled to use the sample data without 3D Systems, Inc.’s prior written consent.

3D Systems, Inc.
Overview
What will you understand in this course?
• Visual Scripting User Interface

• Flexibility with the level of automation and its customization

• Increase the productivity of inspection using scripts

What will you learn to do in this course?


• Run the preset script

• Run the preset script in the Debugging mode

• Create a script that imports multiple meshes and measures overall deviation from a Reference Data automatically

What does this course cover?


Three exercises are provided. Proceed to one of the following exercises for more information.

Exercise Introduction

Run Preset Script

You will learn how to run the preset script and get results.

Run Preset Script in the Debugging mode

You will learn how to debug the preset script and walk through the action sequences.

Create a Script

You will learn how to build a script that imports multiple meshes and measures overall deviation from a
Reference Data automatically.

3D Systems, Inc.
Exercise
Run the preset script
In this step, you will learn how to run the preset script and get results.

1. Run the Geomagic Control X application by executing a GeomagicControlX.exe file.

Default file location is: C:\Program Files\3D Systems\Geomagic Control X <Version Number>

2. Proceed with one of the followings.

[Run the preset script in Geomagic Control X]

a) On the TOOLS tab, in the Script group, click Open the Script folder.

b) Browse Example_02.scrpt file at the following location and open the file by clicking Open.

Default file location is: <Default Program Installation Path>\VisualScripting\Sample\Example_02

c) Click Start to run the selected script.

d) The Visual Script Editor will open and the selected preset script will run automatically.

[Run the preset script in Visual Scripting Editor]

e) On the TOOLS tab, in the Script group, click Visual Script Editor to open the Visual Script Editor.

f) Click Open or go to File > Open.

g) Browse Example_02.scrpt file from the following location and open the file by clicking Open.

Default file location is: <Default Program Installation Path>\VisualScripting\Sample\Example_02

h) In the Visual Scripting Toolbar, click Start or go to Debug > Start to run the script.

3D Systems, Inc.
3. Check if the script runs without any failures and the results are created.

Run the preset script in the Debugging mode


In this step, you will learn how to debug the preset script and walk through the action sequences.

1. Make sure the “Example_02” script is loaded on the Scripting Canvas and nothing is progressed.

2. Right click on the Leading Parameters action and click Add Breakpoint on the Context Menu.

3. In the Visual Scripting Toolbar, click Start to run the script, or go to Debug > Start.

4. When running the script, it will stop at the defined breakpoint locations for analysis.

5. When a script has stopped at a breakpoint, additional controls will appear in the Toolbar, enabling you to Continue
(to the end of the script or to the next breakpoint), Pause, Stop, or Next Step (jump to the next step [action] of the
script).

6. Click Next Step to continue until you want to analyze.

3D Systems, Inc.
Create a Script - Overview
Geomagic Control X Visual Scripting environment is designed to enable you to easily create scripts. It is based on a visual
interface environment, that enables flexibility with the level of automation and its customization. The created scripts can then
be run either within Geomagic Control X or externally, outside the application.

In this exercise, you will learn how to add actions and create a script. A variety of actions is used for building up a script. For
each step, add the actions to the Scripting Canvas and complete sequence by linking one to another.

For more information on the actions available in the Visual Scripting Editor, refer to User Interface Overview > Geomagic
Control X Visual Scripting in the Help document.

What does this exercise cover?

Steps Introduction

Preparations

The File (New Document), Leading Parameters, Search (File Search), and File (Import File) actions are used for
data preparations.

Measurement Setup

The Align (Initial Alignment), Compare (3D Compare), Report (Generate Report), File (Save Document), and two
Expression actions are used for setting up measurements.

3D Systems, Inc.
Setting Up for Target Scan Data

The Search (File Search), Converter (Parameter to Data), For Each, and Converter (ForEach Iterator) actions are
used for importing target Scan Data.

Measurements with Multiple Scan Data

The File (Replace Measured Data) and Edit (Regenerate All) actions are used for setting up measurements with
multiple Scan Data.

Outputs

The three Expression, two Report (Report Manager), and File (Save Document) actions are used for setting up
outputs.

3D Systems, Inc.
3D Systems, Inc.
Step 1. Preparations
In this step, the File (New Document), Leading Parameters, Search (File Search), and File (Import File) actions are used.
Add the actions to the Scripting Canvas and complete sequence by linking one to another.

1. On the TOOLS tab, in the Script group, click Visual Script Editor to open the Visual Script Editor.

2. Make sure if there is any unsaved document open in the Visual Script Editor. If yes, click Save or Save As

to save your document and click New or go to File > New to create a new document.

3. In the Action List, under the Geomagic Control X > File menu, double click File (New Document), or click and
drag it to the Scripting Canvas. The File (New Document) is used to clean up any existing document open in the
application and create a new document.

4. In the Action List, under the General Operations menu, double click Leading Parameters, or click and drag it
to the Scripting Canvas.

3D Systems, Inc.
5. In the Expression input box, type the following two expressions and click Enter. Click Plus icon to add more
expressions. The Leading Parameters is used to define the path of input and output.

Expressions 1: sampleFolder=”..\VisualScripting\Sample\Example_02\Input”

Expressions 2: outputFolder=”C:\TestOutput\Example_02\”

Note: The name of input or output variables can be defined as you desired. The input file path needs to
be pointed to where the target file is located. The out file path can be defined as you desired.

Note: It is recommended to specify the absolute path for input data to avoid any error.

6. In the Action List, under the Geomagic Control X > Search menu, double click Search (File Search), or click
and drag it to the Scripting Canvas.

3D Systems, Inc.
7. In the Action List, under the Geomagic Control X > File menu, double click File (Import File), or click and drag
it to the Scripting Canvas. The File (Import File) is used to import files for the measurements and forward them to
next actions.

8. To define the desirable execution order, link the actions by adding flow connectors. Click Out-Flow of the File (New
Document) action and drag to In Flow of the Leading Parameters action.

3D Systems, Inc.
9. The same way as in the previous step, make the actions linked as shown in the image below.

Note: The output parameter (outputFolder) socket in the Leading Parameters will later be linked to the
input parameter socket in the next Expression.

Step 2. Measurement Setup


In this step, the Align (Initial Alignment), Compare (3D Compare), Report (Generate Report), File (Save Document), and
two Expression actions are used. Add the actions to the Scripting Canvas and complete sequence by linking one to another.

1. In the Action List, under the Geomagic Control X > Align menu, double click Align (Initial Alignment), or click
and drag it to the Scripting Canvas.

3D Systems, Inc.
2. In the Action List, under the Geomagic Control X > Compare menu, double click Compare (3D Compare), or
click and drag it to the Scripting Canvas.

3. In the Action List, under the General Operations menu, double click Expression, or click and drag it to the
Scripting Canvas.

4. In first the Expression, in the Expression input box, type the following expression and click Enter.

o Expressions: ResultName=”Result Data - 1”

3D Systems, Inc.
5. In the Action List, under the Geomagic Control X > Report menu, double click Report (Generate Report), or
click and drag it to the Scripting Canvas.

6. Under the Parameters, type “Letter_Landscape” to the Template input box and click Enter.

7. In the Action List, under the General Operations menu, double click Expression, or click and drag it to the
Scripting Canvas.

8. In second the Expression, in the Expression input box, type the following expression and click Enter.

Expressions: TemplateFileName=outputFolder+”Template.CXProj”

Note: The output parameter (outputFolder) socket in the Leading Parameters will later be linked to the
input parameter (outputFolder) socket.

3D Systems, Inc.
9. In the Action List, under the Geomagic Control X > File menu, double click File (Save Document), or click and
drag it to the Scripting Canvas to save the current measurement as a template for the next measurements.

10. To define the desirable execution order, link the actions by adding flow connectors. Click Out-Flow of the File
(Import File) action and drag to In Flow of the Align (Initial Alignment).

11. The same way as in the previous step, make the actions linked as shown in the image below.

3D Systems, Inc.
Note: Make sure that the output parameter (outputFolder) socket in the Leading Parameters is linked to
the input parameter (outputFolder) socket in the second Expression.

Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

12. Select the actions by clicking them while holding the Ctrl key down on your keyboard or drawing a box around the
actions.

13. Right click and click Group on the Context Menu to make them as a group.

3D Systems, Inc.
14. The selected actions are grouped. Double click the name of the group and change it as you desired.

Note: To change the color of the group box, click the Color Chooser icon and select color as you
desired.

3D Systems, Inc.
Step 3. Setting Up for Target Scan Data
In this step, the Search (File Search), Converter (Parameter to Data), For Each, and Converter (ForEach Iterator) actions
are used. Add the actions to the Scripting Canvas and complete sequence by linking one to another.

1. In the Action List, under the Geomagic Control X > Search menu, double click Search (File Search), or click
and drag it to the Scripting Canvas. The Search (File Search) is used to define the path of target scan data.

2. In the Target Folder input box, type the following file path and click Enter.

..\VisualScripting\Sample\Example_02\TargetMeasuredData

3D Systems, Inc.
3. In the Search (File Search), change the File Type to Scan Files.

4. In the Action List, under the Geomagic Control X > Converter menu, double click Converter (Parameter to
Data), or click and drag it to the Scripting Canvas. The Converter (Parameter to Data) is used to convert data that
is forwarded from files as parameters to Data that can be used for next actions.

5. In the Action List, under the General Operations menu, double click For Each, or click and drag it to the Scripting
Canvas to add the For Each action. The For Each action is used for loop functionality, where each action in the
input list is run.

3D Systems, Inc.
6. In the Action List, under the Geomagic Control X > Converter menu, double click Converter (ForEach Iterator),
or click and drag it to the Scripting Canvas, and then drag it into the For Each action. The Converter (ForEach
Iterator) is used to indicate how many iteration runs within the ForEach action.

7. To define the desirable execution order, link the actions by adding flow connectors. Click Out-Flow of the Search
(File Search) action and drag to In Flow of the Converter (Parameter to Data) action.

8. Select the Search (File Search), Converter (Parameter to Data), and For Each actions by clicking them while
holding the Ctrl key down on your keyboard or drawing a box around the actions.

3D Systems, Inc.
9. Right click and click Group on the Context Menu to make them as a group.

10. The selected actions are grouped. Double click the name of the group and change it as you desired.

11. To define the desirable execution order, link two groups by adding flow connectors. Click Out-Flow of the Save
Document action and drag to In Flow of the Search (File Search) action.

3D Systems, Inc.
Step 4. Measurements with Multiple Scan Data
In this step, the File (Replace Measured Data) and Edit (Regenerate All) actions are used. Add the actions to the Scripting
Canvas and complete sequence by linking one to another.

1. In the Action List, under the Geomagic Control X > File menu, double click File (Replace Measured Data), or
click and drag it to the Scripting Canvas, and then drag it into the For Each action.

3D Systems, Inc.
2. The same way as in the previous step, add Edit (Regenerate All) action and place it into the For Each.

Note: Use the Search Box to search actions in the Action List.

3. Make them linked as shown in the image below.

Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

3D Systems, Inc.
Step 5. Outputs
In this step, the three Expression, two Report (Report Manager), and File (Save Document) actions are used. Add the
actions to the Scripting Canvas and complete sequence by linking one to another.

1. In the Action List, under the General Operations menu, double click Expression, or click and drag it to the
Scripting Canvas, and then drag it into the For Each action.

3D Systems, Inc.
2. The same way as in the previous step, add two more Expressions to the For Each action.

3. In the first Expression, in the Expression input box, type the following expression and click Enter to define the
name of a report.

Expressions: ReportName=”Report 1”

Note: The name of output variables can be defined as you desired.

3D Systems, Inc.
4. In the second Expression, in the Expression input box, type expression and click Enter as follows. The second
Expression is used to define the name of target Measured data.

Expressions: meshName=filenamewithoutextension(valueIn)

Note: The name of input or output variables can be defined as you desired.

Tip: The following functions are available in the Expression action. They can be defined with other
expressions and used for different purposes of functionalities.

Expression Function Description

tostring Converts values to string

Returns the folder name from the specified full path, like
folder
Path.GetDirectoryName .NET Method.

Returns the file name and extension from the specified full path, like
filename
Path.GetFileName .NET Method

Returns the file name without extension from the specified full path, like
filenamewithoutextension
Path.GetFileNameWithoutExtension .NET Method

Returns the extension from the specified full path, like Path.GetExtension .NET
extension
Method

Changes the extension of the specified path, like Path.ChangeExtension(String,


replaceextension
String) .NET Method

Combines folder and file names into a path, like Path.Combine(String,


append
String) .NET Method

5. In the third Expression, in the Expression input box, type the following two expressions and click Enter. Click
Plus icon to add more expressions. The third Expression is used to define the path and the file name of outputs.

3D Systems, Inc.
Expressions 1: cxprojFile=dir + meshName + “.cxproj”

Expressions 2: pdfFile=dir + meshName + “.pdf”

Note: The name of input or output variables can be defined as you desired. The output parameter
(outputFolder) socket in the Leading Parameters will later be linked to the input parameter (dir) socket.

6. In the Action List, under the Geomagic Control X > Report menu, double click Report (Report Manager), or
click and drag it to the Scripting Canvas, and then drag it into the For Each action.

7. Change the Method to Rebuild.

Note: The first Report (Report Manager) is used to run rebuilding a report for new Measured Data.

8. The same way as in the previous step, add one more Report (Report Manager) to the For Each action.

3D Systems, Inc.
9. Change the Method to Report (Export PDF).

Note: The second Report (Report Manager) is used to output the report as a PDF file.

10. In the Action List, under the Geomagic Control X > File menu, double click File (Save Document), or click and
drag it to the Scripting Canvas, and then drag it into the For Each action. The File (Save Document) is used to
save a Control X file once the measurements is done for the Measured Data.

3D Systems, Inc.
11. Place them on the For Each action and make them linked as shown in the image below.

Note: Make sure that the output parameter (outputFolder) socket in the Leading Parameters is linked to
the input parameter (dir) socket in the third Expression.

12. Finally, the script is completed. Right click on the Leading Parameters action and click Add Breakpoint on the
Context Menu.

Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

3D Systems, Inc.
13. In the Visual Scripting Toolbar, click Start to run the script, or go to Debug > Start to test your script.

14. Click Next Step to continue until you want to analyze.

Conclusion
This course is now complete.

You have learned:

• How to run the preset script

• How to run the preset script in the Debugging mode

• How to create a script that imports multiple meshes and measures overall deviation from a Reference Data
automatically

3D Systems, Inc.
MEASURING HOLES
Introduction
This tutorial is intended for users who want to become quickly familiar with Geomagic Control X Visual Scripting.

This step-by-step tutorial will show you what you can accomplish with Visual Scripting in Geomagic Control X. By working
through the tutorial procedures, you will learn how to create scripts and run it as automations on Geomagic Control X.

Data Files
(~<Product Installation Path>\VisualScripting\Sample\Example_03)

• Sample_CAD.X_B, Sample_Scan.stl – Reference and Measured Data for measurements

• Example_03.scrpt – Saved Script

The sample data for this tutorial is provided by 3D Systems, Inc. They are the property of 3D Systems, Inc. and are used for
informational purposes only. Other than to identify this software and publication, individuals or organizations purchasing the
software are not entitled to use the sample data without 3D Systems, Inc.’s prior written consent.

3D Systems, Inc.
Overview
What will you understand in this course?
• Visual Scripting User Interface

• Flexibility with the level of automation and its customization

• Increase the productivity of inspection using scripts

What will you learn to do in this course?


• Run the preset script

• Run the preset script in the Debugging mode

• Create a script that measures holes by creating cylinders on Reference and Measured Data

What does this course cover?


Three exercises are provided. Proceed to one of the following exercises for more information.

Exercise Introduction

Run Preset Script

You will learn how to run the preset script and get results.

Run Preset Script in the Debugging mode

You will learn how to debug the preset script and walk through the action sequences.

Create a Script

You will learn how to build a script that measures holes by creating cylinders on Reference and Measured Data.

3D Systems, Inc.
Exercise
Run the preset script
In this step, you will learn how to run the preset script and get results.

1. Run the Geomagic Control X application by executing a GeomagicControlX.exe file.

Default file location is: C:\Program Files\3D Systems\Geomagic Control X <Version Number>

2. Proceed with one of the followings.

[Run the preset script in Geomagic Control X]

a) On the TOOLS tab, in the Script group, click Open the Script folder.

b) Browse Example_03.scrpt file at the following location and open the file by clicking Open.

Default file location is: <Default Program Installation Path>\VisualScripting\Sample\Example_03

c) Click Start to run the selected script.

d) The Visual Script Editor will open and the selected preset script will run automatically.

[Run the preset script in Visual Scripting Editor]

e) On the TOOLS tab, in the Script group, click Visual Script Editor to open the Visual Script Editor.

f) Click Open or go to File > Open.

g) Browse Example_03.scrpt file from the following location and open the file by clicking Open.

Default file location is: <Default Program Installation Path>\VisualScripting\Sample\Example_03

h) In the Visual Scripting Toolbar, click Start or go to Debug > Start to run the script.

3D Systems, Inc.
3. Check if the script runs without any failures and the results are created.

Run the preset script in the Debugging mode


In this step, you will learn how to debug the preset script and walk through the action sequences.

1. Make sure the “Example_03” script is loaded on the Scripting Canvas and nothing is progressed.

2. Right click on the Leading Parameters action and click Add Breakpoint on the Context Menu.

3. In the Visual Scripting Toolbar, click Start to run the script, or go to Debug > Start.

4. When running the script, it will stop at the defined breakpoint locations for analysis.

5. When a script has stopped at a breakpoint, additional controls will appear in the Toolbar, enabling you to Continue
(to the end of the script or to the next breakpoint), Pause, Stop, or Next Step (jump to the next step [action] of the
script).

6. Click Next Step to continue until you want to analyze.

3D Systems, Inc.
Create a Script - Overview
Geomagic Control X Visual Scripting environment is designed to enable you to easily create scripts. It is based on a visual
interface environment, that enables flexibility with the level of automation and its customization. The created scripts can then
be run either within Geomagic Control X or externally, outside the application.

In this exercise, you will learn how to add actions and create a script. A variety of actions is used for building up a script. For
each step, add the actions to the Scripting Canvas and complete sequence by linking one to another.

For more information on the actions available in the Visual Scripting Editor, refer to User Interface Overview > Geomagic
Control X Visual Scripting in the Help document.

What does this exercise cover?

Steps Introduction

Preparations

The Leading Parameters, Search (File Search), File (Import File), and Align (Initial Alignment) actions are used for
data preparations.

Data Conversion

The Search (Entity Search By Type), Converter (Parameter to Data), For Each, and Converter (ForEach Iterator)
actions are used for data conversion.

Measurements

The Constructed Geometry (Cylinder) action is used for setting up measurements.

3D Systems, Inc.
Step 1. Preparations
In this step, the Leading Parameters, Search (File Search), File (Import File), and Align (Initial Alignment) actions are
used. Add the actions to the Scripting Canvas and complete sequence by linking one to another.

1. On the TOOLS tab, in the Script group, click Visual Script Editor to open the Visual Script Editor.

2. Make sure if there is any unsaved document open in the Visual Script Editor. If yes, click Save or Save As

to save your document and click New or go to File > New to create a new document.

3. In the Action List, under the Geomagic Control X > File menu, double click File (New Document), or click and
drag it to the Scripting Canvas. The File (New Document) is used to clean up any existing document open in the
application and create a new document.

3D Systems, Inc.
4. In the Action List, under the General Operations menu, double click Leading Parameters, or click and drag it
to the Scripting Canvas.

5. In the Expression input box, type the following two expressions and click Enter. The Leading Parameters is used
to define the path of input folder.

Expressions : SampleFolder=”..\VisualScripting\Sample\Example_03”

Note: The name of input variables can be defined as you desired. The input file path needs to be pointed
to where the target file is located.

Note: It is recommended to specify the absolute path for input data to avoid any error.

3D Systems, Inc.
6. In the Action List, under the Geomagic Control X > Search menu, double click Search (File Search), or click
and drag it to the Scripting Canvas.

7. In the Action List, under the Geomagic Control X > File menu, double click File (Import File), or click and drag
it to the Scripting Canvas. The Import File is used to import files for the measurements and forward them to next
actions.

3D Systems, Inc.
8. In the Action List, under the Geomagic Control X > Align menu, double click Align (Initial Alignment), or click
and drag it to the Scripting Canvas.

9. To define the desirable execution order, link the actions by adding flow connectors. Click Out-Flow of the File (New
Document) action and drag to In Flow of the Search (File Search) action.

10. The same way as in the previous step, make the actions linked as shown in the image below.

Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

11. Select the actions by clicking them while holding the Ctrl key down on your keyboard or drawing a box around the
actions.

12. Right click and click Group on the Context Menu to make them as a group.

3D Systems, Inc.
13. The selected actions are grouped. Double click the name of the group and change it as you desired.

Note: To change the color of the group box, click the Color Chooser icon and select color as you
desired.

3D Systems, Inc.
Step 2. Data Conversion
In this step, the Search (Entity Search By Type), Converter (Parameter to Data), For Each, and Converter (ForEach
Iterator) actions are used. Add the actions to the Scripting Canvas and complete sequence by linking one to another.

1. In the Action List, under the Geomagic Control X > Search menu, double click Search (Entity Search By Type),
or click and drag it to the Scripting Canvas.

2. Change the Entity Type to Face and select the Search Filter option to add a filter for selecting desired geometries
only.

3D Systems, Inc.
3. Select the Geometry Type option and change the Geometry Type to Cylinder to search cylindrical features in the
input Reference and Measured Data.

3D Systems, Inc.
4. In the Action List, under the Geomagic Control X > Converter menu, double click Converter (Parameter to
Data), or click and drag it to the Scripting Canvas. The Converter (Parameter to Data) is used to convert data that
is forwarded from files as parameters to Data that can be used for next actions.

5. In the Action List, under the General Operations menu, double click For Each, or click and drag it to the Scripting
Canvas to add the For Each action. The For Each action is used for loop functionality, where each action in the
input list is run.

6. In the Action List, under the Geomagic Control X > Converter menu, double click Converter (ForEach Iterator),
or click and drag it to the Scripting Canvas, and then drag it into the For Each action. The Converter (ForEach
Iterator) is used to indicate how many iteration runs within the ForEach action.

3D Systems, Inc.
7. Make the Converter (Parameter to Data) and the For Each actions linked as shown in the image below.

8. If necessary, select the actions by clicking them while holding the Ctrl key down on your keyboard or drawing a
box around the actions.

9. Right click and click Group on the Context Menu to make them as a group.

3D Systems, Inc.
10. The selected actions are grouped. Double click the name of the group and change it as you desired.

3D Systems, Inc.
Step 3. Measurements
In this step, the Constructed Geometry (Cylinder) action is used. Add the actions to the Scripting Canvas and complete
sequence by linking one to another.

1. In the Action List, under the Geomagic Control X > File menu, double click Constructed Geometry (Cylinder),
or click and drag it to the Scripting Canvas, and then drag it into the For Each action.

Note: Use the Search Box to search actions in the Action List.

3D Systems, Inc.
2. Change the Template to Cylinder.

3. Change the Method to Extract to create cylinders on the cylindric features search from the Reference and
Measured Data.

3D Systems, Inc.
4. Make them linked as shown in the image below.

5. Finally, the script is completed. Right click on the Leading Parameters action and click Add Breakpoint on the
Context Menu.

Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

6. In the Visual Scripting Toolbar, click Start to run the script, or go to Debug > Start to test your script.

7. Click Next Step to continue until you want to analyze.

Conclusion
This course is now complete.

You have learned:

• How to run the preset script

• How to run the preset script in the Debugging mode

• How to create a script that measures holes by creating cylinders on Reference and Measured Data

3D Systems, Inc.
MEASURING GD&T BY USING AN INSPECTION
TEMPLATE
Introduction
This tutorial is intended for users who want to become quickly familiar with Geomagic Control X Visual Scripting.

This step-by-step tutorial will show you what you can accomplish with Visual Scripting in Geomagic Control X. By working
through the tutorial procedures, you will learn how to create scripts and run it as automations on Geomagic Control X.

Data Files
(~<Product Installation Path>\VisualScripting\Sample\Example_04)

• Sample_CAD.X_T (under Input folder) – Reference Data for template project

• Sample_Scan_01~03.stl (under TargetMeasuredData folder) – Target Measured Data for measurements

• Example_04.scrpt – Saved Script

The sample data for this tutorial is provided by 3D Systems, Inc. They are the property of 3D Systems, Inc. and are used for
informational purposes only. Other than to identify this software and publication, individuals or organizations purchasing the
software are not entitled to use the sample data without 3D Systems, Inc.’s prior written consent.

3D Systems, Inc.
Overview
What will you understand in this course?
• Visual Scripting User Interface

• Flexibility with the level of automation and its customization

• Increase the productivity of inspection using scripts

What will you learn to do in this course?


• Run the preset script

• Run the preset script in the Debugging mode

• Create a script that imports multiple meshes and measures GD&Ts by using inspection template automatically

What does this course cover?


Three exercises are provided. Proceed to one of the following exercises for more information.

Exercise Introduction

Run Preset Script

You will learn how to run the preset script and get results.

Run Preset Script in the Debugging mode

You will learn how to debug the preset script and walk through the action sequences.

Create a Script

You will learn how to build a script that imports multiple meshes and measures GD&Ts by using inspection
template automatically.

3D Systems, Inc.
Exercise
Run the preset script
In this step, you will learn how to run the preset script and get results.

1. Run the Geomagic Control X application by executing a GeomagicControlX.exe file.

Default file location is: C:\Program Files\3D Systems\Geomagic Control X <Version Number>

2. Proceed with one of the followings.

[Run the preset script in Geomagic Control X]

1. On the TOOLS tab, in the Script group, click Open the Script folder.

2. Browse Example_04.scrpt file at the following location and open the file by clicking Open.

Default file location is: <Default Program Installation Path>\VisualScripting\Sample\Example_04

3. Click Start to run the selected script.

4. The Visual Script Editor will open and the selected preset script will run automatically.

[Run the preset script in Visual Scripting Editor]

5. On the TOOLS tab, in the Script group, click Visual Script Editor to open the Visual Script Editor.

6. Click Open or go to File > Open.

7. Browse Example_04.scrpt file from the following location and open the file by clicking Open.

Default file location is: <Default Program Installation Path>\VisualScripting\Sample\Example_04

8. In the Visual Scripting Toolbar, click Start or go to Debug > Start to run the script.

3D Systems, Inc.
3. Check if the script runs without any failures and the results are created.

Run the preset script in the Debugging mode


In this step, you will learn how to debug the preset script and walk through the action sequences.

1. Make sure the “Example_04” script is loaded on the Scripting Canvas and nothing is progressed.

2. Right click on the first action (Search) and click Add Breakpoint on the Context Menu.

3. In the Visual Scripting Toolbar, click Start to run the script, or go to Debug > Start.

4. When running the script, it will stop at the defined breakpoint locations for analysis.

5. When a script has stopped at a breakpoint, additional controls will appear in the Toolbar, enabling you to Continue
(to the end of the script or to the next breakpoint), Pause, Stop, or Next Step (jump to the next step [action] of the
script).

6. Click Next Step to continue until you want to analyze.

3D Systems, Inc.
Create a Script - Overview
Geomagic Control X Visual Scripting environment is designed to enable you to easily create scripts. It is based on a visual
interface environment, that enables flexibility with the level of automation and its customization. The created scripts can then
be run either within Geomagic Control X or externally, outside the application.

In this exercise, you will learn how to add actions and create a script. A variety of actions is used for building up a script. For
each step, add the actions to the Scripting Canvas and complete sequence by linking one to another.

For more information on the actions available in the Visual Scripting Editor, refer to User Interface Overview > Geomagic
Control X Visual Scripting in the Help document.

What does this exercise cover?

Steps Introduction

Create Template Project - Preparations

The File (New Document), Leading Parameters, Search (File Search), and File (Import File) actions are used for
data preparations.

Create Template Project - Measurement Setup

The For Each, Converter (ForEach Iterator), File (Import File), Align (Initial Alignment), Align (Datum Alignment),
and two GD&T (Linear Dimension) actions are used for setting up measurements.

3D Systems, Inc.
Setting Up for Target Scan Data

The File (Import File), Edit (Regenerate All), and two Query (GD&T - Dimensions) actions are used for importing
target Scan Data and rebuilding the template project.

Outputs

The Viewpoint (Front View), Zoom (Zoom Fit), two Condition, two Visibility (Show Fail & Warning Only), four
Expression, two File (Save Document), and two Tools (Capture Screen) actions are used for setting up outputs.

3D Systems, Inc.
Step 1. Create Template Project - Preparations
In this step, the File (New Document), Leading Parameters, Search (File Search), and File (Import File) actions are used.
Add the actions to the Scripting Canvas and complete sequence by linking one to another.

1. On the TOOLS tab, in the Script group, click Visual Script Editor to open the Visual Script Editor.

2. Make sure if there is any unsaved document open in the Visual Script Editor. If yes, click Save or Save As

to save your document and click New or go to File > New to create a new document.

3. In the Action List, under the Geomagic Control X > File menu, double click File (New Document), or click and
drag it to the Scripting Canvas. The New Document is used to clean up any existing document open in the
application and create a new document.

3D Systems, Inc.
4. In the Action List, under the General Operations menu, double click Leading Parameters, or click and drag it
to the Scripting Canvas.

5. In the Expression input box, type two expressions and click Enter as follows. Click Plus icon to add more
expressions. The Leading Parameters is used to define the path of input and output.

Expressions 1: InputCAD=”..\VisualScripting\Sample\Example_04\Input”

Expressions 2: InputScan=”..\VisualScripting\Sample\Example_04\TargetMeasuredData”

Expressions 3: outputFolder=”C:\TestOutput\Example_04\”

Note: The name of input or output variables can be defined as you desired. The input file path needs to
be pointed to where the target files are located. The out file path can be defined as you desired.

Note: It is recommended to specify the absolute path for input data to avoid any error.

6. In the Action List, under the Geomagic Control X > Search menu, double click Search (File Search), or click
and drag it to the Scripting Canvas.

3D Systems, Inc.
7. In the Search (File Search), change the File Type to CAD Files to search CAD files from input data.

8. In the Action List, under the Geomagic Control X > File menu, double click File (Import File), or click and drag
it to the Scripting Canvas. The Import File is used to import files for the measurements and forward them to next
actions.

3D Systems, Inc.
9. In the Action List, under the Geomagic Control X > Search menu, double click Search (File Search), or click
and drag it to the Scripting Canvas. This Search (File Search) is used to search target scan files from input data.

10. In the Action List, under the Geomagic Control X > Converter menu, double click Converter (Parameter to
Data), or click and drag it to the Scripting Canvas. The Parameter to Data is used to convert data that is forwarded
from files as parameters to Data that can be used for next actions.

3D Systems, Inc.
11. To define the desirable execution order, link the actions by adding flow connectors. Click Out-Flow of the New
Document action and drag to In-Flow of the Search action.

12. The same way as in the previous step, make the actions linked as shown in the image below.

Note: Make sure that the output parameter (inputCAD) socket in the Leading Parameters is linked to the
Target Folder parameter in the first Search (File Search) action and the output parameter (inputScan)
socket in the Leading Parameters is linked to the Target Folder parameter in the second Search (File
Search) action.

Note: The output parameter (outputFolder) socket in the Leading Parameters will later be linked to the
input parameter socket in the next Expressions.

Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

3D Systems, Inc.
13. Select the actions by clicking them while holding the Ctrl key down on your keyboard or drawing a box around the
actions.

14. Right click and click Group on the Context Menu to make them as a group.

15. The selected actions are grouped. Double click the name of the group and change it as you desired.

Note: To change the color of the group box, click the Color Chooser icon and select color as you
desired.

3D Systems, Inc.
Step 2. Create Template Project - Measurement Setup
In this step, the For Each, Converter (ForEach Iterator), File (Import File), Align (Initial Alignment), Align (Datum
Alignment), and two GD&T (Linear Dimension) actions are used. Add the actions to the Scripting Canvas and complete
sequence by linking one to another.

1. In the Action List, under the General Operations menu, double click For Each, or click and drag it to the Scripting
Canvas to add the For Each action. The For Each action is used for loop functionality, where each action in the
input list is run.

2. In the Action List, under the Geomagic Control X > Converter menu, double click Converter (ForEach Iterator),
or click and drag it to the Scripting Canvas, and then drag it into the For Each action. The Converter (ForEach

3D Systems, Inc.
Iterator) is used to indicate how many iteration runs within the ForEach action.

3. In the Action List, under the General Operations menu, double click Condition, or click and drag it to the
Scripting Canvas. The Condition action is used to judge whether the condition of input data is true or false. The
output flow depends on the results of the conditions.

4. Click and drag the Condition action into the For Each action.

3D Systems, Inc.
5. In the Expression input box, type the following expression and click Enter, and then under the Condition, in the
IF input box, type the following condition and click Enter.

o Expression: ValueOut == ValueOut

o Condition: Index == 0

Note: The following signs may be used in the expressions and conditions.

Sign Condition

== Is equal?

> Is larger?

< Is smaller?

3D Systems, Inc.
|| or

&& and

6. The same way as in the previous step, add File (Import File), Align (Initial Alignment), Align (Datum
Alignment), and two GD&T (Linear Dimension) actions and place them into the For Each.

7. In the Align (Initial Alignment) action, change the Method to Quick as follows.

3D Systems, Inc.
8. In the Align (Datum Alignment) action, type the following parameters in the Datum Pair1, Pair2, and Pair 3, and
click Enter.

o Datum Pair 1: Face<271>@Sample_CAD

o Datum Pair 2: Face<249>@Sample_CAD

o Datum Pair 3: Face<276>@Sample_CAD

Note: You can refer to the unique face ID by opening the Reference Data in Geomagic Control X and
finding their face name in the properties of the target faces.

3D Systems, Inc.
9. The same way as in the previous step, in the GD&T (Linear Dimension) actions, type the following parameters
in the Target 1 and Target 2, and click Enter. Adjust the Max. and Min. Tolerances as follows.

GD&T - Linear Dimension 1 GD&T - Linear Dimension 2

• Target 1: Face<281>@Sample_CAD • Target 1: Face<282>@Sample_CAD

• Target 2: Face<276>@Sample_CAD • Target 2: Face<249>@Sample_CAD

• Tolerance: ±0.3 • Tolerance: ±0.1

10. To define the desirable execution order, link the actions by adding flow connectors. Click Out-Flow of the Converter
(ForEach Iterator) action and drag to In Flow of the Condition.

3D Systems, Inc.
11. The same way as in the previous step, make the actions linked as shown in the image below.

Note: Make sure that the output parameter (Index) socket in the Converter (ForEach Iterator) is linked to
the input parameter (Index) socket in the Condition action and the output parameter (Value out) socket
in the Converter (ForEach Iterator) is linked to the input parameter (Files) in the File (Import File) action.
Additionally, the output parameter (IF) socket in the Condition needs to be linked to the In-Flow of the
File (Import File) action to make a flow processing the measurement with the first input Measured Data.

Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

3D Systems, Inc.
Step 3. Setting Up for Target Scan Data
In this step, the File (Import File), Edit (Regenerate All), and two Query (GD&T - Dimensions) actions are used. Add the
actions to the Scripting Canvas and complete sequence by linking one to another.

1. In the Action List, under the Geomagic Control X > File menu, double click File (Import File), or click and drag
it to the Scripting Canvas, and then drag it into the For Each action. The File (Import File) is used to import a new
Measured Data file.

3D Systems, Inc.
2. The same way as in the previous step, add Edit (Regenerate All) and two Query (GD&T - Dimensions) actions
and place them into the For Each.

3. In the Properties (GD&T - Dimensions) actions, type the following parameters in the Entity Name, and click
Enter.

Properties (GD&T - Dimensions) 1 Properties (GD&T - Dimensions) 2

• Entity Name: Linear Dim.1 • Entity Name: Linear Dim.2

3D Systems, Inc.
4. To define the desirable execution order, link the actions by adding flow connectors. Click Out-Flow of the File
(Import File) action and drag to In Flow of the Edit (Regenerate All) action.

5. The same way as in the previous step, make the actions linked as shown in the image below.

Note: Make sure that the output parameter (Value out) socket in the Converter (ForEach Iterator) is linked
to both the Files parameters in the two File (Import File) actions and the output parameter (ELSE) socket
in the Condition is linked to the In-Flow of the second File (Import File) action. The Connector (marked in
Green) will make a flow processing the measurement with the input Measured Data that is imported
sequentially from the second time.

3D Systems, Inc.
Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

3D Systems, Inc.
Step 4. Outputs
In this step, the Viewpoint (Front View), Zoom (Zoom Fit), two Condition, two Visibility (Show Fail & Warning Only), four
Expression, two File (Save Document), and two Tools (Capture Screen) actions are used. Add the actions to the Scripting
Canvas and complete sequence by linking one to another.

1. In the Action List, under the Geomagic Control X > Viewpoint menu, double click Viewpoint (Front View), or
click and drag it to the Scripting Canvas, and then drag it into the For Each action.

3D Systems, Inc.
2. The same way as in the previous step, add Zoom (Zoom Fit), two Condition, Visibility (Show Fail & Warning
Only), four Expression, and two File (Save Document), and two Tools (Capture Screen) actions and place
them into the For Each.

3. In both the Condition actions, in the Condition (IF) input box, type the following condition and click Enter.

o IF: Result1 == ”Pass” && Result2 == ”Pass”

Note: The following signs may be used in the expressions and conditions.

Sign Condition

== Is equal?

> Is larger?

< Is smaller?

3D Systems, Inc.
|| or

&& and

4. There are four Expression actions. In the two of the Expression actions, in the Expression input box, type the
following expressions and click Enter.

• Expression: LocalValueOut=outputFolder+”Pass\PassFail_Result_” +
filenamewithoutextension(ValueIn) + ”.CXProj”

5. In the rest two of the Expression actions, in the Expression input box, type the following expressions and click
Enter.

• Expression: LocalValueOut=outputFolder+”Pass\PassFail_Result_” +
filenamewithoutextension(ValueIn) + ”.jpg”

Note: The name of input or output variables can be defined as you desired. The output parameter
(outputFolder) socket in the Leading Parameters will later be linked to the input parameter (outputFolder)
socket of each Expression action. The output parameter (Value out) socket in the Converter (ForEach
Iterator) will later be linked to the input parameter (ValueIn) socket of each Expression action.

Tip: The following functions are available in the Expression action. They can be defined with other
expressions and used for different purposes of functionalities.

Expression Function Description

tostring Converts values to string

3D Systems, Inc.
Returns the folder name from the specified full path, like
folder
Path.GetDirectoryName .NET Method.

Returns the file name and extension from the specified full path, like
filename
Path.GetFileName .NET Method

Returns the file name without extension from the specified full path, like
filenamewithoutextension
Path.GetFileNameWithoutExtension .NET Method

Returns the extension from the specified full path, like Path.GetExtension .NET
extension
Method

Changes the extension of the specified path, like Path.ChangeExtension(String,


replaceextension
String) .NET Method

Combines folder and file names into a path, like Path.Combine(String,


append
String) .NET Method

6. In both the Tools (Capture Screen) actions, change the Method to Current View and select the Export Image
option to capture the results of the measurement and export it as an image file.

3D Systems, Inc.
7. Place the actions on the For Each action and make them linked as shown in the image below.

Note: For more information on the connections of General Actions, refer to the table below. Make sure
if all the actions are linked and the flows are defined properly.

3D Systems, Inc.
1st Condition

• Input

• 1st GD&T (Linear Dimension) : Output parameter (Result Status) socket -> 1st
Condition : Input parameter (Result1) socket

• 2nd GD&T (Linear Dimension) : Output parameter (Result Status) socket -> 1st
Condition : Input parameter (Result2) socket

• Output

• 1st Condition : Output parameter (IF) socket -> 1st Visibility (Show Fail & Warning Only)
: In-Flow socket

• 1st Condition : Output parameter (ELSE) socket -> 2nd Visibility (Show Fail & Warning
Only) : In-Flow socket

3D Systems, Inc.
2nd Condition

• Input

• 1st Query (GD&T - Dimensions) : Output parameter (Result Status) socket -> 1st
Condition : Input parameter (Result1) socket

• 2nd Query (GD&T - Dimensions) : Output parameter (Result Status) socket -> 1st
Condition : Input parameter (Result2) socket

• Output

• 1st Condition : Output parameter (IF) socket -> 1st Visibility (Show Fail & Warning Only)
: In-Flow socket

• 1st Condition : Output parameter (ELSE) socket -> 2nd Visibility (Show Fail & Warning
Only) : In-Flow socket

3D Systems, Inc.
1st Expression

• Input

• Leading Parameters : Output parameter (outputFolder) socket -> 1st Expression: Input
parameter (outputFolder) socket

• Converter (ForEach Iterator) : Output parameter (Value out) socket -> 1st Expression:
Input parameter (ValueIn) socket

• Output

• 1st Expression : Input parameter (LocalValueOut) socket -> 1st File (Save Document) :
Input parameter (Geomagic Control X File) socket

3D Systems, Inc.
2nd Expression

• Input

• Leading Parameters : Output parameter (outputFolder) socket -> 2nd Expression:


Input parameter (outputFolder) socket

• Converter (ForEach Iterator) : Output parameter (Value out) socket -> 2nd Expression:
Input parameter (ValueIn) socket

• Output

• 2nd Expression : Input parameter (LocalValueOut) socket -> 2nd File (Save
Document) : Input parameter (Geomagic Control X File) socket

3D Systems, Inc.
3rd Expression

• Input

• Leading Parameters : Output parameter (outputFolder) socket -> 3rd Expression: Input
parameter (outputFolder) socket

• Converter (ForEach Iterator) : Output parameter (Value out) socket -> 3rd Expression:
Input parameter (ValueIn) socket

• Output

• 3rd Expression : Input parameter (LocalValueOut) socket -> 1nd Tools (Capture
Screen) : Input parameter (Image File) socket

3D Systems, Inc.
4th Expression

• Input

• Leading Parameters : Output parameter (outputFolder) socket -> 4th Expression: Input
parameter (outputFolder) socket

• Converter (ForEach Iterator) : Output parameter (Value out) socket -> 4th Expression:
Input parameter (ValueIn) socket

• Output

• 4th Expression : Input parameter (LocalValueOut) socket -> 2nd Tools (Capture
Screen) : Input parameter (Image File) socket

8. Finally, the script is completed. Right click on the first action (Search) and click Add Breakpoint on the Context
Menu.

Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

9. In the Visual Scripting Toolbar, click Start to run the script, or go to Debug > Start to test your script.

10. Click Next Step to continue until you want to analyze.

3D Systems, Inc.
Conclusion
This course is now complete.

You have learned:

• How to run the preset script

• How to run the preset script in the Debugging mode

• How to create a script that imports multiple meshes and measures GD&Ts by using inspection template automatically

3D Systems, Inc.
MEASURING DEVIATIONS AT PREDEFINED
POSITIONS
Introduction
This tutorial is intended for users who want to become quickly familiar with Geomagic Control X Visual Scripting.

This step-by-step tutorial will show you what you can accomplish with Visual Scripting in Geomagic Control X. By working
through the tutorial procedures, you will learn how to create scripts and run it as automations on Geomagic Control X.

Data Files
(~<Product Installation Path>\VisualScripting\Sample\Example_05)

• Sample_CAD.X_T, Sample_Scan.stl (under Input folder) – Reference and Measured Data

• CMP_Points_RM.txt, SimCMM_Points_RMXYZ.txt (under Input folder) – Predefined Position Files

• Example_05.scrpt – Saved Script

The sample data for this tutorial is provided by 3D Systems, Inc. They are the property of 3D Systems, Inc. and are used for
informational purposes only. Other than to identify this software and publication, individuals or organizations purchasing the
software are not entitled to use the sample data without 3D Systems, Inc.’s prior written consent.

3D Systems, Inc.
Overview
What will you understand in this course?
• Visual Scripting User Interface

• Flexibility with the level of automation and its customization

• Increase the productivity of inspection using scripts

What will you learn to do in this course?


• Run the preset script

• Run the preset script in the Debugging mode

• Create a script that measures deviations between Reference and Measured data at the predefined positions.

What does this course cover?


Three exercises are provided. Proceed to one of the following exercises for more information.

Exercise Introduction

Run Preset Script

You will learn how to run the preset script and get results.

Run Preset Script in the Debugging mode

You will learn how to debug the preset script and walk through the action sequences.

Create a Script

You will learn how to build a script that measures deviations between Reference and Measured data at the
predefined positions.

3D Systems, Inc.
Exercise
Run the preset script
In this step, you will learn how to run the preset script and get results.

1. Run the Geomagic Control X application by executing a GeomagicControlX.exe file.

Default file location is: C:\Program Files\3D Systems\Geomagic Control X <Version Number>

2. Proceed with one of the followings.

[Run the preset script in Geomagic Control X]

a) On the TOOLS tab, in the Script group, click Open the Script folder.

b) Browse Example_05.scrpt file at the following location and open the file by clicking Open.

Default file location is: <Default Program Installation Path>\VisualScripting\Sample\Example_05

c) Click Start to run the selected script.

d) The Visual Script Editor will open and the selected preset script will run automatically.

[Run the preset script in Visual Scripting Editor]

a) On the TOOLS tab, in the Script group, click Visual Script Editor to open the Visual Script Editor.

b) Click Open or go to File > Open.

c) Browse Example_05.scrpt file from the following location and open the file by clicking Open.

Default file location is: <Default Program Installation Path>\VisualScripting\Sample\Example_05

d) In the Visual Scripting Toolbar, click Start or go to Debug > Start to run the script.

3D Systems, Inc.
2. Check if the script runs without any failures and the results are created.

Run the preset script in the Debugging mode


In this step, you will learn how to debug the preset script and walk through the action sequences.

1. Make sure the “Example_05” script is loaded on the Scripting Canvas and nothing is progressed.

2. Right click on the first action (File) and click Add Breakpoint on the Context Menu.

3. In the Visual Scripting Toolbar, click Start to run the script, or go to Debug > Start.

4. When running the script, it will stop at the defined breakpoint locations for analysis.

5. When a script has stopped at a breakpoint, additional controls will appear in the Toolbar, enabling you to Continue
(to the end of the script or to the next breakpoint), Pause, Stop, or Next Step (jump to the next step [action] of the
script).

6. Click Next Step to continue until you want to analyze.

3D Systems, Inc.
Create a Script - Overview
Geomagic Control X Visual Scripting environment is designed to enable you to easily create scripts. It is based on a visual
interface environment, that enables flexibility with the level of automation and its customization. The created scripts can then
be run either within Geomagic Control X or externally, outside the application.

In this exercise, you will learn how to add actions and create a script. A variety of actions is used for building up a script. For
each step, add the actions to the Scripting Canvas and complete sequence by linking one to another.

For more information on the actions available in the Visual Scripting Editor, refer to User Interface Overview > Geomagic
Control X Visual Scripting in the Help document.

What does this exercise cover?

Steps Introduction

Preparations

The Leading Parameters, File (New Document), Search (File Search), File (Import File), and Align (Initial
Alignment) actions are used for data preparations.

Importing Simulated CMM Points

The Constructed Geometry (Sim CMM) and Converter (Parameter to Data) are used for importing predefined
CMM position and creating simulated CMM points on it.

RPS Alignment using CMM Points

The For Each, Converter (ForEach Iterator), Data Type (RPS Pair), Data Type (Data Type Array), and Align (RPS

3D Systems, Inc.
Alignment) actions are used for defining RPS pairs and performing a RPS alignment to the target data.

Measurements

The Compare (3D Compare) and Compare (Comparison Point) actions are used for setting up measurements.

Outputs

The two Expression, Report (Generate Report), and Report (Report Manager) actions are used for setting up
outputs.

3D Systems, Inc.
Step 1. Preparations
In this step, the Leading Parameters, File (New Document), Search (File Search), File (Import File), and Align (Initial
Alignment) actions are used. Add the actions to the Scripting Canvas and complete sequence by linking one to another.

1. On the TOOLS tab, in the Script group, click Visual Script Editor to open the Visual Script Editor.

2. Make sure if there is any unsaved document open in the Visual Script Editor. If yes, click Save or Save As

to save your document and click New or go to File > New to create a new document.

3. In the Action List, under the General Operations menu, double click Leading Parameters, or click and drag it
to the Scripting Canvas.

4. In the Expression input box, type the following four expressions and click Enter. Click Plus icon to add more
expressions. The Leading Parameters is used to define the path of input and output data.

3D Systems, Inc.
Expressions 1: InputData=”..\VisualScripting\Sample\Example_05\Input\”

Expressions 2: InputCMP=”..\VisualScripting\Sample\Example_05\Input\CMP_Points_RM.txt”

Expressions 3: OutputData=”C:\TestOutput\Example_05\”

Expressions 4: InputCMM=”..\VisualScripting\Sample\Example_05\Input\SimCMM_Points_RMXYZ.txt”

Note: The name of input or output variables can be defined as you desired. The input file paths need to
be pointed to where the target files are located. The out file path can be defined as you desired.

Note: It is recommended to specify the absolute path for input data to avoid any error.

5. In the Action List, under the Geomagic Control X > File menu, double click File (New Document), or click and
drag it to the Scripting Canvas. The File (New Document) is used to clean up any existing document open in the
application and create a new document.

6. In the Action List, under the Geomagic Control X > Search menu, double click Search (File Search), or click
and drag it to the Scripting Canvas.

3D Systems, Inc.
7. In the Search (File Search), change the File Type to User Defined and type the following expression in the User
Defined Extension, and click Enter to search files with user-defined file formats in the target folder.

Expressions : *.X_T; *.stl

8. In the Action List, under the Geomagic Control X > File menu, double click File (Import File), or click and drag
it to the Scripting Canvas. The File (Import File) is used to import files for the measurements and forward them to
next actions.

3D Systems, Inc.
9. In the Action List, under the Geomagic Control X > Align menu, double click Align (Initial Alignment), or click
and drag it to the Scripting Canvas.

10. To define the desirable execution order, link the actions by adding flow connectors. Click Out-Flow of the Leading
Parameters action and drag to In Flow of the File (New Document) action.

11. The same way as in the previous step, make the actions linked as shown in the image below.

Note: Make sure that the output parameter (InputData) socket in the Leading Parameters is linked to the
Target Folder parameter in the Search (File Search) action.

3D Systems, Inc.
Note: The input parameter (InputCMP and InputCMM) sockets in the Leading Parameters will later be
linked to the input parameter socket in the next actions. The output parameter (OutputData) socket in
the Leading Parameters will later be linked to the input parameter socket in the next Expression.

12. Select the actions by clicking them while holding the Ctrl key down on your keyboard or drawing a box around the
actions.

13. Right click and click Group on the Context Menu to make them as a group.

14. The selected actions are grouped. Double click the name of the group and change it as you desired.

Note: To change the color of the group box, click the Color Chooser icon and select color as you
desired.

3D Systems, Inc.
Step 2. Importing Simulated CMM Points
In this step, the Constructed Geometry (Sim CMM) and Converter (Parameter to Data) actions are used. Add the actions
to the Scripting Canvas and complete sequence by linking one to another.

1. In the Action List, under the Geomagic Control X > Constructed Geometry menu, double click Constructed
Geometry (Sim CMM), or click and drag it to the Scripting Canvas.

3D Systems, Inc.
Note: Use the Search Box to search actions in the Action List.

2. Change the Method to Probe Contact From File to create simulated CMM points from the input data file.

3D Systems, Inc.
3. Type "XYZ" in the Template Name input box to define data for X, Y, and Z locations as listed in the first (X), second
(Y), and third (Z) data columns in the file.

4. In the Action List, under the Geomagic Control X > Converter menu, double click Converter (Parameter to
Data), or click and drag it to the Scripting Canvas. The Converter (Parameter to Data) is used to convert data that
is forwarded from files as parameters to Data that can be used for next actions.

5. To define the desirable execution order, link the actions by adding flow connectors. Click Out-Flow of the Align
(Initial Alignment) action and drag to In Flow of the Constructed Geometry (Sim CMM).

3D Systems, Inc.
6. The same way as in the previous step, make the actions linked as shown in the image below.

Note: Make sure that the output parameter (InputCMM) socket in the Leading Parameters is linked to the
Select File parameter in the Constructed Geometry (Sim CMM) action, and the output parameter (Result
Name) socket in the Constructed Geometry (Sim CMM) is linked to the Parameter in the Converter
(Parameter to Data) action.

7. Select the actions by clicking them while holding the Ctrl key down on your keyboard or drawing a box around the
actions.

3D Systems, Inc.
8. Right click and click Group on the Context Menu to make them as a group.

9. The selected actions are grouped. Double click the name of the group and change it to "Alignments".

Note: If necessary, you can change the name of the group as you desired, but this group will be called
as "Alignments" in the next steps.

3D Systems, Inc.
Step 3. RPS Alignment using CMM Points
In this step, the For Each, Converter (ForEach Iterator), Data Type (RPS Pair), Data Type (Data Type Array), and Align
(RPS Alignment) actions are used. Add the actions to the Scripting Canvas and complete sequence by linking one to another.

1. In the Action List, under the General Operations menu, double click For Each, or click and drag it to the
Alignments group that was created in the previous step. The For Each action is used for loop functionality, where
each action in the input list is run.

2. In the Action List, under the Geomagic Control X > Converter menu, double click Converter (ForEach Iterator),
or click and drag it to the Scripting Canvas, and then drag it into the For Each action. The Converter (ForEach
Iterator) is used to indicate how many iteration runs within the ForEach action.

3D Systems, Inc.
3. The same way as in the previous step, add Data Type (RPS Pair) and Data Type (Data Type Array) actions and
place them into the For Each.

4. In the Data Type (Data Type Array) action, in the Name input box, type a name as you desired. In this exercise,
the name of a data array will be defined as "Array01".

3D Systems, Inc.
Note: The field marked with an asterisk (*) is required.

5. In the Action List, under the Geomagic Control X > Align menu, double click Align (RPS Alignment), or click
and drag it to the Scripting Canvas, and then drag it into the "Alignments" group.

6. Link the actions by adding data connectors. Click the Input socket of the For Each action and drag to the Input
socket of the Converter (ForEach Iterator) action.

3D Systems, Inc.
7. The same way as in the previous step, make the actions linked as shown in the image below.

Note: Make sure that the Input socket in the For Each is linked to the Input socket in Converter (ForEach
Iterator) action, and the output parameter (Data Type Array) socket in the Data Type (Data Type Array) is
linked to the Output socket in the For Each. The simulated CMM points that are passed through the
iterations in the For Each action will be redefined as RPS points, and rearranged in a data array. The
RPS pairs arranged in the data array will be used as input parameters for the RPS alignment.

3D Systems, Inc.
Step 4. Measurements
In this step, the Compare (3D Compare) and Compare (Comparison Point) actions are used. Add the actions to the Scripting
Canvas and complete sequence by linking one to another.

3D Systems, Inc.
1. In the Action List, under the Geomagic Control X > Compare menu, double click Compare (3D Compare), or
click and drag it to the Scripting Canvas to set up measurements.

Note: Use the Search Box to search actions in the Action List.

2. In the Action List, under the Geomagic Control X > Compare menu, double click Compare (Comparison
Point), or click and drag it to the Scripting Canvas to set up measurements.

3D Systems, Inc.
3. Type "XYZ" in the Template Name input box to define data for X, Y, and Z locations as listed in the first (X), second
(Y), and third (Z) data columns in the Comparison Point file that is imported from the folder specified in the Leading
Parameter action.

Note: The input parameter (InputCMP) sockets in the Leading Parameters will later be linked to the
Comparison Point File parameter socket in the Compare (Comparison Point) action.

3D Systems, Inc.
4. Make them linked as shown in the image below.

Note: Make sure that the input parameter (InputCMP) sockets in the Leading Parameters is linked to the
Comparison Point File parameter socket in the Compare (Comparison Point) action.

3D Systems, Inc.
Step 5. Outputs
In this step, the two Expression, Report (Generate Report), and Report (Report Manager) actions are used. Add the actions
to the Scripting Canvas and complete sequence by linking one to another.

1. In the Action List, under the General Operations menu, double click Expression, or click and drag it to the
Scripting Canvas.

2. In the Expression, in the Expression input box, type the following expression and click Enter to specify the target
measurement results.

Expression : TargetResultData="Result Data - 1"

Note: The name of output variables can be defined as you desired.

3D Systems, Inc.
3. In the Action List, under the Geomagic Control X > Report menu, double click Report (Generate Report), or
click and drag it to the Scripting Canvas.

4. Under the Parameters, type “Letter_Landscape” to the Template input box and click Enter.

5. The same way as in the previous step, add another Expression by double clicking Expression under the General
Operations menu, or click and dragging it to the Scripting Canvas.

6. In the second Expression, in the Expression input box, type the following two expressions and click Enter to
specify the target measurement report and the output path for the report. Click Plus icon to add more
expressions.

• Expression 1 : TargetReport="Report 1"

• Expression 2 : TargetFilenFilePath=dir + "Result.xlsx"

Note: The name of input or output variables can be defined as you desired. The output parameter
(OutputData) socket in the Leading Parameters will later be linked to the input parameter (dir) socket in
the second Expression.

3D Systems, Inc.
7. In the Action List, under the Geomagic Control X > Report menu, double click Report (Report Manager), or
click and drag it to the Scripting Canvas.

8. Place the actions on the Scripting Canvas and make them linked as shown in the image below.

Note: Make sure that the output parameter (OutputData) socket in the Leading Parameters is linked to the
input parameter (dir) socket in the second Expression.

3D Systems, Inc.
9. Finally, the script is completed. Right click on the first action (File) and click Add Breakpoint on the Context Menu.

Note: All the fields or parameters marked with an asterisk (*) are required to be filled in or linked before
running a script. Make sure if they are missing.

10. In the Visual Scripting Toolbar, click Start to run the script, or go to Debug > Start to test your script.

11. Click Next Step to continue until you want to analyze.

Conclusion
This course is now complete.

You have learned:

• How to run the preset script

• How to run the preset script in the Debugging mode

• How to create a script that measures deviations between Reference and Measured data at the predefined positions

3D Systems, Inc.

You might also like