Insert Attributes Into Your Rules

You can insert various types of attributes into your rule text.

Use this format:

  • nodePath is the path to a node on your model.
  • attrName is the name of an attribute of the node.

You use a different procedure for each type of attribute.

Type of Attribute Format Example

Custom attribute that you create on the model

nodePath.userAttrs["attrGroupName. attrName"]

Assume you create an attribute named Color:

  • Open the rule editor.
  • Expand the Structure area, then click the node, such as MY_THEATER.
  • In the Attributes area, click Item, then notice all your custom attributes.
  • Click your Color attribute, then click Insert into Rule Text.

Your user's actions and your rules don't affect the attribute's value, so the attribute value is static at run time.

'Home Theater System'.'Speaker System'.userAttrs["PhysicalAttributes.Color"]
Supplemental

nodePath.suppAttrs["attrName"]

Do the same steps that you do to add a custom attribute, except click Supplemental.

Your user's actions and your rules don't affect the attribute's value, so the attribute value is static at run time.

'Home Theater System'.'Speaker System'.suppAttrs["color"]
Transactional

nodePath.transAttrs["attrName"]

Select the attribute in the Structure area of the rule editor, then click Insert Into Rule Text.

Your user's actions and your rules affect the attribute's value, so the value of a transactional attribute is dynamic at run time.

ADD 'Custom Window'.'Frame'.transAttrs["Linear Length"]/5 TO 'Custom Window'.'Frame'.'Track'.Quantity()

Here we have an example that includes a window and window track. Each track is 5 feet long. This example divides the linear length of the window by 5, then adds it to the number of tracks that the window needs.

System attribute, such as:

  • Name
  • Value
  • Quantity
  • State
  • Options
  • SelectedCount

nodePath.attrName()

Do the same steps that you do to add a custom attribute, except click Supplemental.

'Home Theater System'.'Speaker System'.'5.1'.Quantity()

Guidelines for Using Transactional Attributes in Your Rule

You can map a constraint to all occurrences of a transactional attribute in a set of nodes. For example, if node x has a value of 1, then prevent the user from selecting or entering a value 1 for the Weight transactional attribute:

(x = 1)EXCLUDES OC.Selection().transAttrs["Weight"] = 1

You can't use a path to reference a value for a transactional attribute. You must reference the value as a literal in a conditional expression. For example:

(x) EXCLUDES (y.transAttrs["BaseWeight"] < 10)

You can't use the Selection system attribute with a transactional attribute. This restriction applies even if the transactional attribute has a value set that Configurator displays at run time, such as the values that it displays for an option feature. However, you can use Selection with an option feature.

For background details, see Transactional Attributes.