New Attribute Block
Where Is It?
The new attribute block is located in the Categories drawer of the Blawx toolbox.
What Does It Do?
The new attribute block is used to add an attribute to a category.
The new attribute block is a statement block, and can be stacked with other statements.
It accepts a category to which the attribute should be applied, specified in a dropdown, a name for the attribute specified in a text field, and an attribute type specified in a dropdown.
The datatype can be a scalar data type like "number", or another category.
The block also accepts an order for how the attribute should be displayed in natural language, either with the object appearing first, or the value appearing first. It also accepts prefix, infix, and postfix text to define how the attribute should be expressed in natural language. This information will be used in the attribute selector block for this attribute, as well as in explanations.
If you choose "true / false" as the attribute type, the block will no longer collect the order or infix text, as they are not required.
To be valid, an attribute name must
- contain only numbers, underscores, and letters
- begin with a lowercase letter
- not end in an underscore followed by only digits
The block will automatically remove leading and trailing spaces, convert spaces to underscores, and convert an initial uppercase letter into lowercase. Other invalid values will be rejected, and the value of the field will not be changed.
Note that if you specify a data type as the attribute type your attribute selector blocks will only accept the correct type of value, and variables in the value position. If you choose a category as the data type, your attribute selector blocks will accept any object, or a variable.
Attribute names should be unique, even as between different categories. Boolean attributes must not share names with categories.