Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

11/10/13

Constraining attributes of a Dynamic Component | SketchUp Knowledge Base

Knowledge Center
Search the Knowledge Center...

Constraining attributes of a Dynamic Component


T his is a Pro only fe a ture . 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 subcomponents.

Note: Configuring a dynamic component is easier when the component is placed at the origin of the axes in SketchUp.

2. Context-click on the component. The component's context menu is displayed. 3. Select the D yna mic C ompone nts > C ompone nt A ttribute s menu item. The Component Attributes dialog box is displayed. 4. Click the + button next to the Fence component. An empty list of attributes appears for the component.

help.sketchup.com/en/article/114559

1/4

11/10/13

Constraining attributes of a Dynamic Component | SketchUp Knowledge Base

3D for ... Our Produc ts

Ev ery one...
B uy Le a rn

5. 6. 7. 8.

Click on the a dd a ttribute button in the last row of the Fence component. A list of predefined attributes is displayed. The field is opened for editing. Click on Pos ition in the list of predefined attributes. All of the position attributes are displayed for the component. Click on the a dd a ttribute button in the last row of the Fence component. A list of predefined attributes is displayed. The field is opened for editing. 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.

9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21.

All of the attributes are faded gray color to indicate they are not constrained to a specific value. Double-click in the field next to the LenY attribute in the Fence component. The field is opened for editing. Erase the current value. Type = 4in the 'LenY' field to constrain the length of the Fence component in the Y direction (the fence cannot be scaled in the Y direction). Press the T a b 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). Click on the + next to the TopRail sub-component to display its attributes. Click on the a dd a ttribute button in the last row of the TopRail component. A list of predefined attributes is displayed. The field is opened for editing. Click on Pos ition in the list of predefined attributes. All of the position attributes are displayed for the component. Click on the a dd a ttribute button in the last row of the TopRail component. A list of predefined attributes is displayed. The field is opened for editing. Click on 'Size' in the list of predefined attributes. All of the size attributes are displayed for the component. Double-click in the field next to the X attribute in the TopRail sub-component. The field is opened for editing. Erase the current value. Type = 4in 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).

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

22. 23. 24. 25. 26.

Press the T a b key to accept the formula. Double-click in the field next to the Y attribute. The field is opened for editing. Erase the current value. Type = 1 . 2 5in 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). Press the T a b key to accept the formula.

help.sketchup.com/en/article/114559

2/4

11/10/13

Constraining attributes of a Dynamic Component | SketchUp Knowledge Base

27. Double-click in the field next to the Z attribute. The field is opened for editing. 28. Type = F e n c e ! L e n Z 9in 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). 29. Press the T a b 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:

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.

30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41.

Double-click in the field next to the LenX attribute. The field is opened for editing. Erase the current value. Type = F e n c e ! L e n X P o s t ! L e n Xin TopRail's 'LenX' field. The length of the TopRail will be constrained to the length of Fence minus the length of the post (4"). Press the T a b key to accept the formula. Double-click in the field next to the LenY attribute. The field is opened for editing. Erase the current value. Type = 1 . 5in TopRail's 'LenY' field. The thickness of TopRail is set to 1.5". Press the T a b key to accept the formula. Double-click in the field next to the LenZ attribute. The field is opened for editing. Erase the current value. Type = 3 . 5in TopRail's 'LenZ' field. The height of TopRail is set to 3.5". Press the T a b 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:

42. 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. 43. Click on the C los e button. 44. 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).

Tags
SketchUp | dynamic-components | how-to

About Us The SketchUp Story

Programs K-12 Education Higher Education Visiting Professionals Non-Profit Grants Project Spectrum

Developers SketchUp Ruby API SketchUp SDK Plugins Developer Forum

Help Knowledge Center Forum Contact Us

Connect Blog SketchUpdate

2013 Trimble Navigation Limited | Privacy | Terms of Service

English

help.sketchup.com/en/article/114559

3/4

11/10/13

Constraining attributes of a Dynamic Component | SketchUp Knowledge Base

help.sketchup.com/en/article/114559

4/4

You might also like