Basic Library Version: 9

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
0 Nothing is drawn.
1 Only the left side is drawn.
2 Only the right side is drawn.
3 Both sides are drawn.
Note, that controlling wndSide lets you place adjacent windows horizontally without unwanted side-effects.
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.
0 Default method.
1 Nominal size measured between jambs.
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
Turn the plaster at reference side:
(the thick line represents it)
bOverOut Boolean
Turn the plaster at opposite side:
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
  Description Example
0 No cavity closure.
1 Traditional mode.
2 Heat insulation mode.
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
stClosureMethod String One dimension Array parameter for receiving value list of gs_closureMethod
stWndSide String One dimension Array parameter for receiving value list of gs_cavity_side
stTurnDir String One dimension Array parameter for receiving value list of gs_nTurnDir
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 Trapeze wall
Curved wall Curved wall

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 EPS = 0.0001,
                            A   = SYMB_A_SIZE,
                            WOD = WOD

mul2 get (2)

curvedWall = get (1)
wallIsLeft = get (1)

angOrig    = get (1)
inRadius   = get (1)
ofsX       = get (1)
ofsY       = get (1)

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

Copyright © 2004 - Graphisoft R&D Software Development Rt. All rights reserved worldwide.