Dynamic component predefined attributes
Following is a list of all predefined attributes for use in creating your dynamic components.
X, Y, Z
The X, Y, and Z attributes contain the value for the component's X (red), Y (green), or Z (blue) coordinate.
LenX, LenY, LenZ
The LenX, LenY, and LenZ attributes contain the length of the component in the X (red), Y (green), or Z (blue) direction.
RotX, RotY, RotZ
The RotX, RotY, and RotZ attributes contain the rotation about the X, Y, or Z axis, in degrees.
Hidden
The Hidden attribute contains either a 1 (TRUE) to hide the component or 0 (FALSE) to unhide the component.
Copies
The Copies attribute contains the number of copies of the component to be created by SketchUp. Every copy will be created at the exact X, Y, and Z coordinates of the original. The Copies attribute is usually used in conjunction with the Copy attribute.
Copy
The Copy attribute contains the copy number of a specific copy. So for example, if Copies is equal to 3, Copy can contain 0 through 3 (0 being the original). Copy is generally used within formulas (so it's more of a variable than an attribute) to refer to a specific copy (usually to position that copy to different X, Y, and Z coordinates). For example, you might have a formula that positions copies of pickets on a fence horizontally along the X axis. The formula for X would look like=5+Copy*(Fence!spacing+LenX)
.
If 'Fence!spacing' for the picket is 4" and the width (LenX) of the picket is 2.5", this formula resolves to 5" for the X value of the original component (5+0*(4+2.5))
. The formula resolves to 11.5
for the first copy (5+1*(4+2.5))
, 18
for the second copy (5+2*(4+2.5))
, and so on for each copy of the picket.
You can only see copies of a component in the Outliner (Window > Outliner), not in the Component Attributes dialog box. Therefore, you can never look at the attribute/value pairs for a copy.
Name
The Name attribute contains the name of the component as you would like it to appear in the Component Options dialog box.
Summary
The Summary attribute contains a brief, one sentence summary of the component for the Component Options dialog box.
Description
The Description attribute contains a longer description of the component for the Component Options dialog box.
ItemCode
The ItemCode attribute contains a manufacturer item code for the product represented by the dynamic component.
ImageURL
The ImageURL attribute contains a URL to a GIF, JPG, or PNG file on the Internet that you want to appear in the Component Options dialog box. For example, if ImageURL is equal to http://mysite.com/myimage.gif
, then 'myimage.gif' image would appear, instead of the SketchUp-generated thumbnail, inside the Component Options dialog box.
DialogWidth
The DialogWidth attribute contains the width, in pixels, of the Component Options dialog box.
DialogHeight
The DialogHeight attribute contains the width, in pixels, of the Component Options dialog box.
onClick
The onClick attribute contains a simple script identifying how the component will react to being clicked (using the Interact tool). For example, if the onClick attribute contained alert("Hello World");
, an alert box would display when a user clicked on the component. Refer to 'onClick functions' for further information.
Material
The Material attribute contains the material to apply to the component. The material can be in several formats:
- A named color, such as 'Blue' (See Ruby API docs for complete list of colors).
- A hexadecimal string, such as '#FFFF00' or '3399A0' (the # is optional).
- A three number list of RGB values (between 0 and 255). For example, 255, 128, 0.
- A material name that exists in the InModel material list. Your dynamic component needs to have a tiny swatch of the material you want displayed embedded somewhere on the component. The material also needs to have a custom name. For example,"0002_HotPink' won't work unless you rename it to be '0002_MyHotPink').