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 container

  • All shapes, lines, circles, and annotations are parametric

  • Coordinates are defined using inline X, Y attributes

  • Use Guard or GuardX for conditional rendering

  • Use T="Repeat" for arrays of objects (e.g., reinforcement bars)

CADD Object Types:

  1. T="CADD" - Drawing Container

  2. T="CADDShape" - 2D Polygon/Polyline

  3. T="CADDCircle" - Circle/Reinforcement Bar

  4. T="CADDDimensionLine" - Dimension Annotation

  5. T="CADDLine" - Open Polyline

  6. T="CADDText" - Text Labels


T="CADD" - Drawing Container

The 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

Draws closed polygons (filled shapes) using a series of points. Points are connected in order and automatically closed.

Attributes:

  • N (String): Name of the shape

  • Color (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])

  • Guard or GuardX (Expression, optional): Conditional rendering

  • X, 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 lines

  • Common patterns: [6,3] = short dash, [10,30] = long dash with gap


T="CADDCircle" - Circle

Draws circles, typically used for reinforcement bars in concrete sections or other circular features.

Attributes:

  • N (String, optional): Name of the circle

  • X, Y (Number): Center coordinates

  • Radius (Number or Parameter): Circle radius

  • Color (String, optional): Fill/stroke color

  • Thickness (Number, optional): Line thickness in pixels

  • LineStyle (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:

  • Radius can be defined as an attribute or as a child <P> parameter

  • Use Segments="36" for smooth circles (higher = smoother but slower)

  • RZ="0" is standard for circles (rotation doesn't affect appearance)


T="CADDDimensionLine" - Dimension Annotation

Draws 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 dimension

  • Guard or GuardX (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

Draws open polylines (lines that don't close back to start point).

Attributes:

  • N (String): Name of the line

  • Color (String, optional): Line color

  • Thickness (Number, optional): Line thickness in pixels

  • LineStyle (Array, optional): Dash pattern

Children: Multiple T="Point" objects defining the line path

Example:

Notes:

  • Unlike CADDShape, the line does NOT automatically close

  • Use for reference lines, construction lines, or open paths


T="CADDText" - Text Label

Adds text annotations to drawings. Text can include parameter values using |paramName| syntax.

Attributes:

  • N (String): Name of the text object

  • X, Y (Number): Text position

  • RZ (Number, optional): Rotation angle in degrees

Children Parameters:

  • Color (String, T="Text"): Text color

  • Thickness (Number): Line thickness for text rendering

  • Size (Number): Text size multiplier

  • Text (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 text

  • Functions like round() can be used: |round(value,2)|

  • T="Text" attribute is required for Color, Text, and IsClosed parameters


CADD Drawing Best Practices

1. Conditional Rendering with Guards

Use Guard or GuardX attributes for conditional visibility of drawing elements.

Example:

Notes:

  • Use GuardX or Guard for boolean conditions

  • Multiple 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:

  1. Calculate number of elements

  2. Create Repeat loop

  3. Use loop index i to 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 name

  • i="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 elements

  • Build shapes with T="CADDShape" (closed polygons) and T="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 Guard for conditional rendering based on parameters

  • Use 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