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:

  1. 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.
  2. Bring your geometry into Grasshopper in any manner you choose. I prefer to use a Geometry Pipeline.
  3. Create Design Frame Elements using the Create Design Frame Element component.
  4. 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.
  5. Use the Assign Frame Rotation component to assign a cross section rotation, in degrees, to your Design Frame Elements.

Assign Rotation from Attribute.png

Components Used