Add Family Instance by Location ( point/plane )

Hello guys,

I have a problem with the node of Addfamilyinstance.bylocation.
This node is working fine with the point input, but when I’m trying to place it by plane the family element doesn’t follow the plane rotation. As you see in the pictures, the floor opening supposes to rotate accordingly to the plane input.

Or if place first the family and then rotate the family later the output is NULL. Does Rhino.inside has the node like dynamo ( FamilyInstance.SetRotation).

Thank you guys,

Rotation_1

The trick is to create a plane and use a plane to specify the point and rotation of the family on insert. This sample at the end covers the creation and use of the plane for rotation: https://www.rhino3d.com/inside/revit/beta/samples/column-family-along-curve#placing-family-instances

1 Like

Hello Scott,

I have tried your suggestion to create the plane, and yes it’s working, but only working for the Famly that not embedded with a host like furniture or etc.

But when I tried with the Family that embedded to the host, the rotation of the family is not accordingly to the given plane.

Here is the Screenshot of my trials.

Thank you

Not working family rotation (embedded inside the host)

Working Famliy rotation (without host)

Hey @s.mazlan
What do you mean by family embedded inside a host?

Hi @eirannejad

Maybe my sentence is not correct. Sorry for that, What I mean is the Hosted Family and Non-Hosted Family.

The Addfamilyinstance.bylocation only working with Non-Hosted Family as the previous Screenshot.

When I’m using the “Deckenöffnung Rechteckig” family (hosted family) for the floor, the outcome doesn’t rotate as the Plane input.
Thank You

Hey @s.mazlan
I created a quick python script node that realigns the family instances to the given plane after they are placed.

Take a look at these example files

Align Family Instance.zip (519.1 KB)

I also filed an issue to correct this behaviour:

Hi @eirannejad,

I tried your script and its work within your example file, but when I tried to copy the Phyton Node (Align Instance) to my file, Its does not work and gave me an error.

The instance(s) actually not out side of the host. its still in the host family.

Thank You.

Would you mind sharing a sample model and the family that your are using plus your GH definition so I can replicate the error on my side and attemp to provide a solution?

Thanks :slight_smile:

Hi @eirannejad,

This is the file of mine. Thank you for willing to help me.

Best Regards.

Rotating Family.zip (6.8 MB)

1 Like

Okay so the clash points that you are collecting are not scaled to the Revit model units.

This is the location of the instance:

And this is the plane origin that you are trying to reorient to:

I changed the python node to reorient based on the location of the instance itself but use the X and Y axis directions from the plane:

Also added data type checks. Change the python code to this:

import clr
clr.AddReference('System.Core')
clr.AddReference('RhinoInside.Revit')
clr.AddReference('RevitAPI') 
clr.AddReference('RevitAPIUI')

from System import Enum

import rhinoscriptsyntax as rs
import Rhino
import RhinoInside
import Grasshopper
from RhinoInside.Revit import Revit, Convert
from Autodesk.Revit import DB

doc = Revit.ActiveDBDocument

clr.ImportExtensions(RhinoInside.Revit)

if isinstance(I, DB.FamilyInstance) and isinstance(L, Rhino.Geometry.Plane):
    t = DB.Transaction(doc, "Align Instance")
    t.Start()
    I.Pinned = False
    I.SetTransform(I.Location.Point, L.XAxis.ToHost(), L.YAxis.ToHost())
    I.Pinned = True
    t.Commit()

Here is proof of work:

2 Likes

Thanks for your amazing work. I copy your script and paste it to the new python node, and its work.

*ps: In addition, I introduce an output to the Python node so I can continue to work with the element

Thank you :star_struck: :star_struck:

1 Like