CADD Drawing Guide
Overview
CADD (Computer-Aided Design and Drafting) in ParamML is used to create 2D technical drawings for cross-sections, elevations, and detail views. CADD drawings are parametric visualizations that automatically update when input parameters change.
Key Concepts:
CADD drawings are defined using XML object types with
T="CADD"as the containerAll shapes, lines, circles, and annotations are parametric
Coordinates are defined using inline
X,YattributesUse
GuardorGuardXfor conditional renderingUse
T="Repeat"for arrays of objects (e.g., reinforcement bars)
CADD Object Types:
T="CADD"- Drawing ContainerT="CADDShape"- 2D Polygon/PolylineT="CADDCircle"- Circle/Reinforcement BarT="CADDDimensionLine"- Dimension AnnotationT="CADDLine"- Open PolylineT="CADDText"- Text Labels
T="CADD" - Drawing Container
T="CADD" - Drawing ContainerThe main container for a CADD drawing. Contains all shapes, dimension lines, text, and other drawing elements.
Attributes:
N(String): Name of the drawing
Example:
T="CADDShape" - 2D Polygon
T="CADDShape" - 2D PolygonDraws closed polygons (filled shapes) using a series of points. Points are connected in order and automatically closed.
Attributes:
N(String): Name of the shapeColor(String, optional): Line/fill color (e.g., "black", "red", "rgb(255,0,0)")Thickness(Number, optional): Line thickness in pixels (default: 1)LineStyle(Array, optional): Dash pattern[dashLength, gapLength](e.g.,[6,3],[10,30])GuardorGuardX(Expression, optional): Conditional renderingX,Y(Number, optional): Shape offset from origin
Children: Multiple T="Point" objects defining the polygon vertices
Example:
Notes:
Points are automatically closed (last point connects to first)
Use
LineStyle="[dashLength,gapLength]"for dashed/dotted linesCommon patterns:
[6,3]= short dash,[10,30]= long dash with gap
T="CADDCircle" - Circle
T="CADDCircle" - CircleDraws circles, typically used for reinforcement bars in concrete sections or other circular features.
Attributes:
N(String, optional): Name of the circleX,Y(Number): Center coordinatesRadius(Number or Parameter): Circle radiusColor(String, optional): Fill/stroke colorThickness(Number, optional): Line thickness in pixelsLineStyle(Array, optional): Dash pattern[dashLength, gapLength]Segments(Number, optional): Number of segments for smoothness (default: 36)RZ(Number, optional): Rotation angle in degrees (usually 0)Guard(Expression, optional): Conditional rendering
Example:
Notes:
Radiuscan be defined as an attribute or as a child<P>parameterUse
Segments="36"for smooth circles (higher = smoother but slower)RZ="0"is standard for circles (rotation doesn't affect appearance)
T="CADDDimensionLine" - Dimension Annotation
T="CADDDimensionLine" - Dimension AnnotationDraws dimension lines with arrows showing measurements. Requires exactly 3 points.
Structure:
Point 1: Start of dimension (measured element's start)
Point 2: End of dimension (measured element's end)
Point 3: Identical to Point 2 + offset (determines dimension line placement)
Dimension Direction Rules:
Horizontal dimensions: Points 1 and 2 have same Y, different X (left to right)
Vertical dimensions: Points 1 and 2 have same X, different Y (bottom to top)
Offset: Third point adds offset in perpendicular direction
Attributes:
N(String): Name of the dimensionGuardorGuardX(Expression, optional): Conditional rendering
Children: Exactly 3 T="Point" objects
Example:
Notes:
Works best for horizontal and vertical dimensions
Third point determines where dimension line appears relative to measured element
For no offset, make third point identical to second point
T="CADDLine" - Open Polyline
T="CADDLine" - Open PolylineDraws open polylines (lines that don't close back to start point).
Attributes:
N(String): Name of the lineColor(String, optional): Line colorThickness(Number, optional): Line thickness in pixelsLineStyle(Array, optional): Dash pattern
Children: Multiple T="Point" objects defining the line path
Example:
Notes:
Unlike
CADDShape, the line does NOT automatically closeUse for reference lines, construction lines, or open paths
T="CADDText" - Text Label
T="CADDText" - Text LabelAdds text annotations to drawings. Text can include parameter values using |paramName| syntax.
Attributes:
N(String): Name of the text objectX,Y(Number): Text positionRZ(Number, optional): Rotation angle in degrees
Children Parameters:
Color(String, T="Text"): Text colorThickness(Number): Line thickness for text renderingSize(Number): Text size multiplierText(String, T="Text"): The text content (can include|paramName|for values)TextAlign(Number): Alignment (0=left, 1=center, 2=right)IsClosed(String, T="Text"): Set to "T" for proper rendering
Children Objects: 3 T="Point" objects defining text box bounds
Example:
Notes:
Use
|parameterName|to embed parameter values in textFunctions like
round()can be used:|round(value,2)|T="Text"attribute is required forColor,Text, andIsClosedparameters
CADD Drawing Best Practices
1. Conditional Rendering with Guards
Use Guard or GuardX attributes for conditional visibility of drawing elements.
Example:
Notes:
Use
GuardXorGuardfor boolean conditionsMultiple elements can have complementary guards
Guards are evaluated dynamically when parameters change
2. Using Repeat for Arrays
Use T="Repeat" to create arrays of objects, such as reinforcement bars in concrete sections.
Pattern:
Calculate number of elements
Create Repeat loop
Use loop index
ito position each element
Example:
For Symmetric Arrays (Left and Right):
Notes:
S= Start index (usually 0)E= End index (inclusive)I= Increment (usually 1)CTRL="i"defines loop variable namei="0"sets initial value
Common Coordinate System
Typical convention for cross-sections:
Y=0 at reference line (often top of section or top flange)
Negative Y goes downward
X=0 at section centerline
Negative X to the left, Positive X to the right
Example:
Best Practice: Document your coordinate system clearly in comments at the start of each CADD drawing.
Summary
CADD drawings in ParamML:
Use
T="CADD"as container for all drawing elementsBuild shapes with
T="CADDShape"(closed polygons) andT="CADDCircle"(circles)Add dimensions with
T="CADDDimensionLine"(3 points: start, end, offset)Add open paths with
T="CADDLine"(polylines)Add labels with
T="CADDText"(supports parameter values with|param|)Use
Guardfor conditional rendering based on parametersUse
T="Repeat"for arrays of objects (reinforcement bars, bolt patterns, etc.)Define coordinates consistently and document your coordinate system
All CADD objects update automatically when parameters change
Generated for AI Agents working with OpenBrIM ParamML Code
Last updated