Go to start of banner

# KB180099556: ArtiosCAD - Understanding geometry macros: Placing a normal parametric geometry macro

Choose your language for a machine translation:

## Question

Understanding geometry macros: Placing a normal parametric geometry macro.

Assume this simple rebuildable panel with LWD = 8,0,12 Further, assume the glue flap below which is implemented as a normal geometry macro. Note that this is parametric geometry macro with a depth of D. It also contains a menu of variables which describe the shape of the glue flap. The macro can be added to the design. The variables from the macro will be presented to the user as such when it is added to the main design: Note that the rebuildable panel described above was defined in terms of L, D = 12. Further note that the macro is also defined in terms of D. In the case of a normal macro, the macro is run in its own context, isolated from the main workspace. The macro does not access any data in the workspace and all geometry is still contained within the macro. This means, that despite sharing common variable names, the variable D from the macro is *not* the same variable D in the panel. The value of D in the panel is 12 and here the value of 6 was entered. The glue flap will be added to the workspace with its own, independent D (depth) of 6.

The log file for the main design is logged with the following command.  The variables in the macro are treated as parameters in the GEOMTOOL command and the values that were specified by the user at the time the macro was added are passed into the macro when this GEOMTOOL command is rerun.

`GEOMTOOL "gsy_Macro.ARD" POS START(:S:U:U1:R2,2) WITH D=6*#I G=0.5*#I R=0.000000 R1=0.000000 R3=0.000000 T=10.0000 LAYERS ITEMREF (:S:U:U1,3)` Even if the main design is rebuilt using a different value for D (now 16), as described above the macro runs in its own context and the depth variables D are independent. The main design logged the geometry macro with its depth (D) of 6 and will ignore whatever value was specified for the panel’s depth (D).  The glue flap’s depth therefore remains at 6. However, the macro can still be added parametrically. When the macro is added to the main workspace, specify D for the macro depth as such: In this case, even though the macro has its own variable D defined (initially 0 or whatever the default value was set to within the macro), the user is passing in D(12) from the main workspace. The macro is logged as such:

`GEOMTOOL "gsy_Macro.ARD" POS END(:S:U:U1:R1,1) WITH D=D G=0.5*#I R=0.000000 R1=0.000000 R3=0.000000 T=10.0000 LAYERS ITEMREF (:S:U:U1,2)`

Whenever the main design is rebuilt and its depth (D) is modified by the user, the new value for D will be passed into the GEOMTOOL command and the macro's depth variable D will now be initialized with the main design's depth (D) and will be rebuildable from the point forward.

Article information
Applies to