Attributes
General knowledge about Element Attributes in Swarm
Last updated
General knowledge about Element Attributes in Swarm
Last updated
Attributes are metadata that is attached to Swarm’s geometrical Inputs and Outputs. They map to Parameters in Revit and Properties in Rhino. All geometrical Swarm Inputs and Outputs have Attributes attached to them.
Using Attributes, metadata is attached to geometrical Input data on its way into Swarm Apps. A referenced curve in the Rhino Client has Color, Layer, and Name attributes built in, and those attribute values are populated using Rhino data when the curve is referenced, along with any custom attributes defined in the Attribute User Text panel.
Attributes can be read from App Input parameters using our Grasshopper components. You can use these attributes to drive your App’s internal logic. For example, you could read the Name of a referenced curve from Rhino, and apply a modified version of that name to some Output geometry. Here’s an App that copies a curve, and applies a modified version of the Input Name attribute value to the copy.
As demonstrated in the example above, Attributes can be constructed in an App, and Injected into a Swarm Output using our Grasshopper components. These attributes will stick to the Output data within Saved States, and will be applied to the baked geometry from the App.
Clicking on an Element in the Viewer will list its Attributes in a table.
Clicking on a row of the table will activate Color by Attribute - all of the objects in the model will be colored along a linear color gradient using the selected Attribute’s values. Attributes and color scales can be chosen/modified in the dropdowns in the Visualization Options > Color by Attributes sections.
Color by Attribute allows Authors to include beautiful, interactive data visualizations in their Apps.
When Color by Attribute is enabled and new computes are triggered in the Viewer, designers are able to make sense of a ton of generative data in very short order by playing around with sliders and using their eyeballs.
Adding Attributes to your App’s Outputs involves some work, but the UX payoffs can be significant for your users - especially in large scale, data-intensive design applications.
The ID Attribute has a special role in Swarm. Using the ID Attribute and the Sync Mode in the Desktop Clients allows Apps to update data in the host application, as opposed to generating new data.
A modified version of the Copy Curve App shown in the Reading and Writing Attributes in Apps section above is presented here as an example. Instead of copying a curve, this App moves a Curve.
We’re still working through supporting this feature in all Clients. Updates work well in Revit and CSI, OK in Rhino, and are not yet supported in Illustrator.
More info coming soon here. For now, refer to the Desktop Clients Support pages.