![]() |
If you perform a task repeatedly, you can take advantage of a macro to automate it. A macro is a series of functions, written in a scripting language, that you group in a single command to perform the requested task automatically. | |
![]() |
This task will show you how to edit a macro created in the DMU Optimizer workbench. | |
![]() |
Open the ThicknessMacro.CATScript
from the sample folder with a Text editor
You stored your recorded macros in a text format file. For more details about recording, running macros refer to the DMU Navigator Infrastructure User's Guide. |
|
![]() |
You can easily modify the macro
instructions specific to DMU Optimizer (strings of characters put in bold). Here is an example:
|
|
THICKNESS MACRO |
EXPLANATIONS |
|
Language="VBSCRIPT" Sub CATMain() Dim productDocument1 As Document Dim dMOThicknesses1 As DMOThicknesses Dim product1 As Product Dim groups1 As AnyObject
|
||
Dim group1 As Group Set group1 = groups1.Add() group1.AddExplicit product1 Dim dMOThicknesses1 As
AnyObject |
Name of the product selected for the
thickness. Enter a meaningful name if you wish to edit the name. |
|
![]() |
||
Dim
arrayOfVariantOfDouble1(5) arrayOfVariantOfDouble1(0) = 1665.173462 arrayOfVariantOfDouble1(1) = -682.007568 arrayOfVariantOfDouble1(2) = -29.914585 arrayOfVariantOfDouble1(3) = -0.006795 arrayOfVariantOfDouble1(4) = -0.173679 arrayOfVariantOfDouble1(5) = 0.984779 Dim document1 As Document Set document1 = dMOThicknesses1.ComputeAThickness(group1, 2.000000, -2.000000, 0, arrayOfVariantOfDouble1) Dim optimizerWorkBench1 As Workbench Set optimizerWorkBench1 = productDocument1.GetWorkbench("OptimizerWorkBench") groups1.Remove group1 document1.Activate |
2.000000, -2.000000, Gives the values of the offset 1 and offset 2, you defined. | |
![]() |
||
1 corresponds to the number
orientation constraints.
arrayOfVariantOfDouble1(0) = 1665.173462
arrayOfVariantOfDouble1(3) = -0.006795 |
||
document1.SaveAs
"./Product1_THICKNESS.cgr" productDocument1.Activate productDocument1.Activate End Sub |
Gives the location of the cgr file you saved. | |
![]() |
Note: From V5R11, the calculation changes: offset1 and offset2 values make the selected surface move to two opposite directions (i.e. two positive values equal to 2mn will result in a thickness of 4mm). | |
Open the ThickR11.CATScript document to access a V5R11 thickness macro (taking in account this behavioral change) | ||
Open the SilhouetteMacro.CATScript document from the samples folder | ||
![]() |
Silhouette macro example :
Dim arrayOfVariantOfDouble1(17) |
Coordinates of
the first viewpoint vector :
arrayOfVariantOfDouble1(0) = 1.000000 and so on... |
![]() |
||
|