Constraining attributes of a Dynamic Component

PRO This is a Pro only feature.

A constrained dynamic component is a component that has elements (sub-components or sub-groups) that, when scaled with the Scale tool, will not change size or orientation to the axes. To constrain entities of a dynamic component:

  1. Create a new component that is comprised entirely from groups or sub-component instances, each with a unique name. Following is an image of the fence component used in this example. This component contains 4 sub-components: post,top rail, bottom rail, and picket sub-components. The parent component and each sub-component have a unique name. For example, the parent component is called Fence and it contains Post, TopRail, BottomRail, and Picket sub-components.
  2. Note: Configuring a dynamic component is easier when the component is placed at the origin of the axes in SketchUp.

  3. Context-click on the component. The component's context menu is displayed.
  4. Select the Dynamic Components > Component Attributes menu item. The Component Attributes dialog box is displayed.
  5. Click the + button next to the Fence component. An empty list of attributes appears for the component.
  6. Click on the add attribute button in the last row of the Fence component. A list of predefined attributes is displayed. The field is opened for editing.
  7. Click on Position in the list of predefined attributes. All of the position attributes are displayed for the component.
  8. Click on the add attribute button in the last row of the Fence component. A list of predefined attributes is displayed. The field is opened for editing.
  9. Click on 'Size' in the list of predefined attributes. All of the size attributes are displayed for the component. The following image shows these attributes within the Fence component.
  10. All of the attributes are faded gray color to indicate they are not constrained to a specific value.
  11. Double-click in the field next to the LenY attribute in the Fence component. The field is opened for editing.
  12. Erase the current value.
  13. Type =4 in the 'LenY' field to constrain the length of the Fence component in the Y direction (the fence cannot be scaled in the Y direction).
  14. Press the Tab key to accept the formula. The value for LenY (4) is displayed in black to indicate it is constrained (the fence cannot be resized using the Scale tool).
  15. Click on the + next to the TopRail sub-component to display its attributes.
  16. Click on the add attribute button in the last row of the TopRail component. A list of predefined attributes is displayed. The field is opened for editing.
  17. Click on Position in the list of predefined attributes. All of the position attributes are displayed for the component.
  18. Click on the add attribute button in the last row of the TopRail component. A list of predefined attributes is displayed. The field is opened for editing.
  19. Click on 'Size' in the list of predefined attributes. All of the size attributes are displayed for the component.
  20. Double-click in the field next to the X attribute in the TopRail sub-component. The field is opened for editing.
  21. Erase the current value.
  22. Type =4 in the 'X' field of the TopRail to constrain the TopRail to 4" along the X axis from the Fence's origin (to accommodate the 4" width of the Pole). Generally, you want all of your sub-component's values constrained. Some of the parent's values might be constrained depending on the type of component you are creating. For example, the Fence's thickness (LenY) is constrained to 4". But all other values, including Fence's location to SketchUp's axes (X,Y, and Z) are unconstrained so it can be moved anywhere and scaled in the X and Z directions (LenX and LenZ).

  23. Note: Constrained values appear in solid black text. Unconstrained values (values that could be altered when scaling a component) are in light gray.

  24. Press the Tab key to accept the formula.
  25. Double-click in the field next to the Y attribute. The field is opened for editing.
  26. Erase the current value.
  27. Type =1.25 in the 'Y' field of the TopRail to constrain the TopRail to 1.25" along the Y axis from the Fence's origin (the middle of the Pole).
  28. Press the Tab key to accept the formula.
  29. Double-click in the field next to the Z attribute. The field is opened for editing.
  30. Type =Fence!LenZ-9 in the 'Z' field of the TopRail to constrain the Pole's Z value using a formula based on the overall height of the Fence (Fence!LenZ).
  31. Press the Tab key to accept the formula. The value of TopRail's Z is constrained to 9 inches below the length of Fence (Fence!LenZ). The following image shows the changes made in steps 9 through 29:
  32. Tip: Move the cursor over a field and click the mouse button to create a reference to the content in that field in your formulas. For example, clicking on the LenZ field of Fence would place 'Fence!LenZ' in the currently edited formula.

  33. Double-click in the field next to the LenX attribute. The field is opened for editing.
  34. Erase the current value.
  35. Type =Fence!LenX-Post!LenX in TopRail's 'LenX' field. The length of the TopRail will be constrained to the length of Fence minus the length of the post (4").
  36. Press the Tab key to accept the formula.
  37. Double-click in the field next to the LenY attribute. The field is opened for editing.
  38. Erase the current value.
  39. Type =1.5 in TopRail's 'LenY' field. The thickness of TopRail is set to 1.5".
  40. Press the Tab key to accept the formula.
  41. Double-click in the field next to the LenZ attribute. The field is opened for editing.
  42. Erase the current value.
  43. Type =3.5 in TopRail's 'LenZ' field. The height of TopRail is set to 3.5".
  44. Press the Tab key to accept the formula. All of TopRail's default attributes are now constrained so that the component will not change its position and size when scaled. The following image shows the changes made in steps 30 through 41:
  45. Continue constraining all of the default attributes (X,Y,Z, LenZ, LenY, and LenZ) for each of Fence's sub-components. Hint: you will want to constrain the LenZ of the picket to some value that is relative to the Fence's LenZ so the picket resizes proportionally to the fence in the Z (blue) direction.
  46. Click on the Close button.
  47. Use the Scale tool to scale your component. The component should only scale in the directions that are unconstrained (the X and Z directions). Sub-components should retain their dimensions (such as post and picket width and depth).
Was this article helpful?