This page will show you how to assign a frame cross section rotation based on a user attribute assigned to the object in Rhino.
User attributes are an easy way to assign custom data to Rhino geometry. They are useful for many different properties, but one in particular is the cross section rotation of a frame element. Often times it is easier to define these in the Rhino environment if the rotations are somewhat random and don’t make use of an easily parameterizable value.
The procedure is:
- Create geometry in Rhino and assign a user attribute to it. I like to use “Rotation” as the attribute name. Assign a rotation value to this attribute, in degrees. A positive rotation is counterclockwise about the local 1-axis.
- Bring your geometry into Grasshopper in any manner you choose. I prefer to use a Geometry Pipeline.
- Create Design Frame Elements using the Create Design Frame Element component.
- Get the specific user attribute value from the Rhino objects using the Get Attribute component. The “Object” input on this component is the Rhino object, not the frame element that was created from the Rhino object. So in my case, I would plug my Geometry Pipeline into the “Object” input. The “Attribute” input should be a text value that matches your user attribute name. The “Default” input should be the value you want to be returned should no user attribute be found. If you haven’t assigned an attribute to every line that you are creating frames from, you should set this to the typical cross section rotation angle.
- Use the Assign Frame Rotation component to assign a cross section rotation, in degrees, to your Design Frame Elements.
Components Used