So I’ve been playing around with a script to place family instances based on the location and rotation of an existing element from another Revit category as this is not possible OOTB.
The background is that my firm often uses detail elements for furnishing building designs in the early design stages, and at some point, if the proposal gets accepted, we transition towards a more “BIM compatible” workflow with actual “Furniture” elements instead of 2D overlays.
The setup seems simple enough: Get all instances of a selected detail item. Read their positions (x, y, z) and view on which they’re placed. Read their rotation relative to the x- or y-Axis. Select a furniture family to replace the detail items with. Place it using aforementioned position and rotation parameters. Lastly, delete redundant detail items.
However, my results have been… inconsistent. The position and rotation of the newly placed furniture elements are kinda “close enough” to their detail item counterparts, but rarely match exactly. Sometimes the rotation is right, but the location of the inserted element is not quite right, as if the origins of the families don’t match (which they do). Sometimes, the insertion point is right, but the family is rotated by 180°. The fact that two families can look exactly the same in a Revit view, but have different values for rotation, isMirrored, isFlipped and so on doesn’t exactly help either.
Anyway, is there someone on here who has dealt with these problems before and can share their experience?
Gavin, thanks for the reply. I’ve been a long time viewer of your YT channel
I just double checked and both families are facing the same way.
Below is an example of an existing furnished room built with detail items as furniture after running my Dynamo script (correctly positioned elements marked in green, incorrectly rotated elements marked red):
Yep I reckon that’s it, nice one @jacob.small … test below:
Without checking for flips/mirrors:
With checking:
My rotation node when dealing with point based families will return the Rotation property of an element’s LocationPoint:
@hwo.osa glad to hear the content has been handy. See below a script using some nodes from Crumple which accounts for the flip/mirror conditions in various combinations, and might at least solve the rotation bug. RE placement points that’s a big harder to determine, but if placement points are in expected locations it’s got me stumped. Maybe some families don’t have defined origin planes and the family has to assume its origin in some cases?
My guess on the location is that one of the tables has constraints planes to adjust the size of the family, but that they aren’t maintaining a relationship to the origin.
This means that for mirrored detail items, placing the family at the same origin as the detail item and rotating around the objects center will always result in a faulty rotation, no matter the input angle. You would need to place, rotate, then mirror to get the same exact transformation. I’ll try that and keep you posted
Edit: @jacob.small when you say “complete transform”, what do you mean? Is there a node to get/set the total transform including isMirrored and isHandFlipped properties?