Rotate & swap values

3 min read

When spatial planning, some practices prefer to use proxy Revit elements to speed up the design iteration process. For example, this methodology for the early stages of healthcare projects where the schedule of accommodation is critical. In this workflow, an architectural column family is created, which represents a Revit room. It contains various instance parameters, including the width and length. This workflow allows users to easily flex the family without fear of the room ‘breaking’ due to a missing wall. Hence, it is a quick and dirty spatial planning tool before we proceed to substitute these families for real Revit rooms and walls.

Proxy Revit element

The family has a 2D door family nested into it. The user can decide where the door is to be placed by using instance parameters. However, to ensure fast computation, only two adjacent walls are available for the door to be placed. If the door is required to be in the opposite wall, the family can be flipped using the instance hands. Sometimes when placing the family, users will not set the rotation correctly, resulting in doors not opening onto the corridor. Since only two door locations are possible, the family must be rotated 90 degrees, flipped if required, and then the width and length parameters swapped.

Rotate and swap parameters

Obviously, prevention is better than cure, but if some families do manage to slip through the gaps, you can use the ‘Family.RotateAndSwapParameters‘ custom node available in the BVN Dynamo package. The node will rotate the family 90 degrees and swap the width and length parameters. By default, these parameters are named ‘SP_Width’ and ‘SP_Depth’, but they can be updated to suit your shared parameter names. After running the script, the room should look the same but with the door on the adjacent wall.

Existing rotation

The custom node first calculates the existing rotation of the family. Known as ‘Facing orientation‘, the rotation is expressed as a vector within the Revit API. If you try to rotate the family 90 degrees using the ‘FamilyInstance.SetRotation’ node, it will override the facing orientation rather than adding 90 degrees to the existing rotation.

Rotation angle

Therefore, we need to use the ‘Vector.AngleAboutAxis’ node to compare the existing facing orientation to the Y-axis to calculate the existing rotation in degrees. Once calculated, we can set the rotation to equal the existing rotation plus 90 degrees. After that, it is just a matter of swapping the width and length values.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Rhino Inside Revit for Dynamo users

Rhino.Inside Revit for Dynamo users

Learn some of the key differences between Dynamo and Rhino.Inside Revit and discover the benefits of migrating certain Dynamo workflows to Rhino.Inside Revit.

Views from Sun with Rhino.Inside Revit
Premium

Views from sun with Rhino.Inside Revit

Learn how to generate views from the sun using Rhino.Inside Revit to visually verify the results of a Ladybug solar access heatmap.

Balcony Area and Depth with Dynamo
Premium

Min balcony area and depth

Verify a balcony’s minimum area and depth with Dynamo for compliance with the NSW Apartment Design Guide and SEPP65 requirements.

Copyright​

© 2023 Parametric Monkey
Parametric Monkey and the Parametric Monkey logo are trademarks of Parametric Monkey Pty Ltd.

CONTACT US

Drop us a message and someone from our team will be in touch with you shortly.

BOOM!

Thank you for your interest. Someone from our team will be in touch soon.

WORKSHOP APPLICATION

To find out about upcoming public workshops or to organise a private workshop, please submit the following contact form and we’ll be in touch soon.