Use constraints in SketchUp to keep groups or sub-components at a set size or orientation to the axes when you scale a dynamic component. Follow these steps to set the constraints.
- Create a component made entirely of groups or sub-component instances, each with a unique name. The example image shows a fence with 4 sub-components: a post, top rail, bottom rail and picket. The parent component is named Fence. Its sub-components are named Post, TopRail, BottomRail and Picket.

- Context-click the component to open its context menu.
- Select Dynamic Components > Component Attributes to open the Component Attributes dialog box.
- Click the + button next to Fence to show its empty attribute list.

- Click add attribute in the last row of Fence. A list of predefined attributes appears, and the field opens for editing.
- Click Position in the predefined attributes list to show all position attributes for Fence.
- Click add attribute in the last row of Fence. A list of predefined attributes appears, and the field opens for editing.
- Click 'Size' in the predefined attributes list to show all size attributes for Fence. The following image shows these attributes.

- The attributes appear in light grey because they are not constrained to specific values.
- Double-click the field next to LenY in Fence to edit it.
- Delete the current value.
- Type
=4in the 'LenY' field to constrain Fence's length in the Y direction. This prevents scaling in that direction. - Press Tab to accept the formula. The LenY value (4) appears in black to show it is constrained. You cannot resize this dimension with the Scale tool.
- Click + next to TopRail to show its attributes.
- Click add attribute in the last row of TopRail. A list of predefined attributes appears, and the field opens for editing.
- Click Position in the predefined attributes list to show all position attributes for TopRail.
- Click add attribute in the last row of TopRail. A list of predefined attributes appears, and the field opens for editing.
- Click 'Size' in the predefined attributes list to show all size attributes for TopRail.
- Double-click the field next to X in TopRail to edit it.
- Delete the current value.
- Type
=4in TopRail's 'X' field to position it 4" along the X axis from Fence's origin. This allows for the Pole's 4" width. You generally constrain all sub-component values. The parent values you constrain depend on the component. In this example, Fence's thickness (LenY) is constrained to 4". All other parent values remain unconstrained, including its position relative to SketchUp's axes (X, Y and Z). This lets you move Fence anywhere and scale it in the X and Z directions (LenX and LenZ).
- Press Tab to accept the formula.
- Double-click the field next to Y to edit it.
- Delete the current value.
- Type
=1.25in TopRail's 'Y' field to position it 1.25" along the Y axis from Fence's origin, at the middle of the Pole. - Press Tab to accept the formula.
- Double-click the field next to Z to edit it.
- Type
=Fence!LenZ-9in TopRail's 'Z' field to constrain the Pole's Z value using Fence's overall height (Fence!LenZ). - Press Tab to accept the formula. TopRail's Z value is constrained to 9 inches below Fence's height (Fence!LenZ). The following image shows the changes made in steps 9 through 29.

- Double-click the field next to LenX to edit it.
- Delete the current value.
- Type
=Fence!LenX-Post!LenXin TopRail's 'LenX' field. This constrains TopRail's length to Fence's length minus the post's length (4"). - Press Tab to accept the formula.
- Double-click the field next to LenY to edit it.
- Delete the current value.
- Type
=1.5in TopRail's 'LenY' field to set its thickness to 1.5". - Press Tab to accept the formula.
- Double-click the field next to LenZ to edit it.
- Delete the current value.
- Type
=3.5in TopRail's 'LenZ' field to set its height to 3.5". - Press Tab to accept the formula. All of TopRail's default attributes are now constrained, so scaling cannot freely change its position or size. The following image shows the changes made in steps 30 through 41.

- Constrain all default attributes (X, Y, Z, LenZ, LenY and LenZ) for each remaining sub-component of Fence.
- Click Close.
- Scale the component with the Scale tool. It should scale only in the unconstrained X and Z directions. Sub-components should keep their constrained dimensions, such as the width and depth of the posts and pickets.