Cavity Closure Macro
1. General Description
This macro is commonly used by ArchiCAD windows to draw cavity closure and turned plasters in 2D.
The macro's output fulfils the following requirements:
- all wall geometries currently supported in ArchiCAD (straight, trapeze or curved) are handled well
- handles curved panel windows in curved walls
- uses the composite line structure of the wall
- avoids overlapping polygons for DXF/DWG export
- handles contour / inner status of lines for DXF/DWG export
- all display modes (solid modes also) are concerned and handled well
- can turn any number of skins in traditional mode
The WallBlock macro is being used to draw the blocks that the skins are built from: this results in a uniform 2D drawing method regardless of the current wall geometry. The CompositeLogic macro returns the composite structure information required to draw the skins in the wall.
2. Parameters
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wndSide | Integer |
|
||||||||||||
| bWndCurved | Boolean | Is the window made of curved panels? | ||||||||||||
| bCornerWindow | Boolean | Is the window part of a corner window? | ||||||||||||
| bJambInner | Boolean | Identifies the window nominal width measuring method.
|
||||||||||||
| iRevealType | Integer | Type of the reveal
|
||||||||||||
| gs_reveal_left_angle | Angle | Left Side Angle | ||||||||||||
| gs_reveal_right_angle | Angle | Right Side Angle | ||||||||||||
| gs_reveal_top_angle | Angle | Upper Side Angle | ||||||||||||
| gs_reveal_bottom_angle | Angle | Bottom Side Angle | ||||||||||||
| gs_turn_plaster | Title | Plaster | ||||||||||||
| gs_bOverIn | Boolean | Only effective in the Parameter script | ||||||||||||
| gs_bOverOut | Boolean | Only effective in the Parameter script | ||||||||||||
| bOverIn | Boolean |
|
||||||||||||
| bOverOut | Boolean |
|
||||||||||||
| gs_closureMethod | Title | Cavity Closure | ||||||||||||
| gs_cavity_side | String | Only effective in the Parameter script | ||||||||||||
| gs_nTurnDir | String | Only effective in the Parameter script | ||||||||||||
| cType | Integer |
Closure method
|
||||||||||||
| Traditional | Title | "Traditional" cavity closure method | ||||||||||||
| nTurnIn | Integer | Number of turned skins from the reference side in traditional mode. | ||||||||||||
| nTurnOut | Integer | Number of turned skins from the opposite side in traditional mode. | ||||||||||||
| Strip | Title | Insulation strip (available only in traditional mode) | ||||||||||||
| gs_bJoint | Boolean |
Is there an insulation strip at the front side of the turned skins?
|
||||||||||||
| gs_thkJoint | Length | Thickness of the insulation strip. | ||||||||||||
| gs_penJoint | Pencolor | Contour pen of the insulation strip. | ||||||||||||
| gs_ltJoint | Linetype | Contour line type of the insulation strip. | ||||||||||||
| gs_fillJoint | Fillpattern | Fill pattern of the insulation strip. | ||||||||||||
| gs_penJointFg | Pencolor | Fill foreground pen of the insulation strip. | ||||||||||||
| gs_penJointBg | Pencolor | Fill background pen of the insulation strip. | ||||||||||||
| Insulated | Title | "Heat Insulation" cavity closure method | ||||||||||||
| widthPlug | Length | Width of the insulation plug. | ||||||||||||
| gs_penPlug | Pencolor | Contour pen of the insulation plug. | ||||||||||||
| gs_ltPlug | Linetype | Contour line type of the insulation plug. | ||||||||||||
| gs_fillPlug | Fillpattern | Fill pattern of the insulation plug. | ||||||||||||
| gs_penPlugFg | Pencolor | Fill foreground pen of the insulation plug. | ||||||||||||
| gs_penPlugBg | Pencolor | Fill background pen of the insulation plug. | ||||||||||||
| StackedWindow | Title | Stacked Window | ||||||||||||
| gs_stack_left | Boolean | |||||||||||||
| gs_stack_right | Boolean | |||||||||||||
| gs_stCavityClosure | String | One dimension Array parameter for receiving locale strings | ||||||||||||
| gs_nTurn | Boolean | Only effective in the Parameter script |
3. Usage
Coordinate system
Before using this macro, the caller window must align the local coordinate system to the x and y axes and place the origin into the natural opening origin marked with a black dot. The prevailing local y axis must be parallel with the end face of the wall cut:
| Trapeze wall | ![]() |
|---|---|
| Curved wall | ![]() |
Localization
The macro's default language is the English, but you can localize it with the gs_stCavityClosure parameter.
| Row | Default value | Description |
|---|---|---|
| 1 | None | Value list item - gs_closureMethod |
| 2 | Traditional | Value list item - gs_closureMethod |
| 3 | Prefabricated | Value list item - gs_closureMethod |
| 4 | Reference side | Value list item - gs_nTurnDir |
| 5 | Opposite side | Value list item - gs_nTurnDir |
| 6 | Both | Value list item - gs_cavity_side |
| 7 | Left | Value list item - gs_cavity_side |
| 8 | Right | Value list item - gs_cavity_side |
| 9 | Cavity Closure and Custom Reveal | UI String - tabpage name |
| 10 | Cavity Closure | UI String - static text (title of the upper left pane) |
| 11 | Closure Method | UI String - gs_closureMethod |
| 12 | Cavity Side | UI String - static text - gs_cavity_side |
| 13 | Number of Turned Skins | UI String - gs_nTurn |
| 14 | Number from | UI String - gs_nTurnDir |
| 15 | Turn at Reveal | UI String - gs_bTurnReveal |
| 16 | Insulation Strip | UI String - gs_bJoint |
| 17 | Thickness | UI String - gs_thkJoint |
| 18 | Contour Pen | UI String - gs_penJoint and gs_penPlug |
| 19 | Line Type | UI String - gs_ltJoint and gs_ltPlug |
| 20 | Fill Type | UI String - gs_fillJoint and gs_fillPlug |
| 21 | Fill Pen | UI String - gs_penJointFg and gs_penPlugFg |
| 22 | Fill Back. Pen | UI String - gs_penJointBg and gs_penPlugBg |
| 23 | Profile | UI String - static text |
| 24 | Width | UI String - gs_widthPlug |
| 25 | Turn Plaster | UI String - static text |
| 26 | Reference-Side | UI String - gs_bOverOut |
| 27 | Opposite-Side | UI String - gs_bOverIn |
Example scripts
The following example 2D script demonstrates the usage of this macro (see the WallLogic macro for further details on its parameters):
Master Script
dim stTurnDir[] stTurnDir[1] = `Reference side` stTurnDir[2] = `Opposite side`
2D Script
WOD = abs(WIDO_ORIG_DIST) call "WallLogic" PARAMETERS gs_macro_version = 10, EPS = 0.0001, A = SYMB_A_SIZE, WOD = WOD, RETURNED_PARAMETERS mirrorX, mirrorY, curvedWall, wallIsLeft, angOrig, iRadius, ofsX, ofsY mul2 mirrorX, mirrorY bCornerWindow = ac_cw_function & ac_corner_window if curvedWall & wallIsLeft then bOverIn = gs_bOverOut bOverOut = gs_bOverIn else bOverIn = gs_bOverIn bOverOut = gs_bOverOut endif if gs_nTurnDir = stTurnDir[1] then ! 'Reference side' if curvedWall & wallIsLeft then nTurnIn = gs_nTurn nTurnOut = 0 else nTurnIn = 0 nTurnOut = gs_nTurn endif endif if gs_nTurnDir = stTurnDir[2] then ! 'Opposite side' if curvedWall & wallIsLeft then nTurnIn = 0 nTurnOut = gs_nTurn else nTurnIn = gs_nTurn nTurnOut = 0 endif endif call "CavityClosure" PARAMETERS A = A, bWndCurved = gs_IsCurved, bCornerWindow = bCornerWindow, cType = 1, ! 'Traditional' wndSide = 3, ! Both sides os_left = gs_left_oversize, os_right = gs_right_oversize, gs_stack_left = gs_stack_left, gs_stack_right = gs_stack_right, bJambInner = 0, bOverIn = bOverIn, bOverOut = bOverOut, nTurnIn = nTurnIn, nTurnOut = nTurnOut, gs_bJoint = gs_bJoint, gs_thkJoint = gs_thkJoint, gs_penJoint = gs_penJoint, gs_ltJoint = gs_ltJoint, gs_fillJoint = gs_fillJoint, gs_penJointFg = gs_penJointFg, gs_penJointBg = gs_penJointBg
Turned plasters
The bOverIn (bOverOut) parameters are independent of the cavity closure mode being used inside the wall. The turned plaster has the same thickness (marked with T in the following figure) as the first (last) skin in the compositete structure. Note, that the plaster is turned to the window frame.
The drawn plaster uses the same contour pen and linetype as the last composite skin. The second image displays only the contour lines which are used in DXF/DWG export.
The following table contains the minimum number of composite skins (nSkinMin) to draw these plasters:
| bOverIn | bOverOut | nSkinMin |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 2 |
| 1 | 0 | 2 |
| 1 | 1 | 3 |
Traditional mode
The nTurnIn and nTurnOut parameters cannot be nonzero at the same time. They control the number of skins turned from or to the reference line.
Let's assume, that there are N skins in the composite: in this case the following limitations are valid on these integer parameters (whether the plasters are turned or not):
| bOverIn | bOverOut | nTurnMax |
|---|---|---|
| 0 | 0 | N - 2 |
| 0 | 1 | N - 3 |
| 1 | 0 | N - 3 |
| 1 | 1 | N - 4 |
If nTurnMax is less than one, then no skins are turned by this macro. Otherwise the macro turns as much skins inside the wall composite up to the given nTurnMax.
Heat insulation mode
This is the newer approach of cavity closure done in ArchiCAD.
![]() |
If there is no plaster skin modelled on either side, then the plug fits between the first and the last skins. |
![]() |
If there is a plaster skin modelled on the reference side, and bOverIn is true, then the plug fits between the second and the last skins. |
![]() |
If there is a plaster skin modelled on the opposite side, and bOverOut is true, then the plug fits between the first skin and the skin next to the last one. |
![]() |
Finally, if there are plaster skins modelled on both sides, and both bOverIn and bOverOut are true, then the plug fits between the second skin and the skin next to the last one. |
4. Remarks
At current time, there is no 2D wall cut in ArchiCAD. If we want to draw anything inside the wall, then a "patch polygon" of equivalent size must be applied before the draw operation. This can be carried out by drawing a polygon with Empty fill, where the background color is -1 (Transparent). See the following example:
The following steps are required to draw the desired area:
Step 1a: the original wall |
Step 1b: the area where we want to draw; |
Step 2: place the patch polygon |
Step 3: draw the composite skins |














