I’m trying to insert face based families through dynamo. I got it to work using the “FamilyInstance.ByFace” node, but i can only use surfaces from elements or system-families (like walls). What i want to achieve is to use reference planes to do the same (in other words: I would like to use a reference plane as a host for my face-based families). It seems that reference planes don’t have “surfaces” to use as the host.
As far as i know it is not possible to place a face base family on a reference plane and that the reference plane is the host
it is possible to place a fb family with dynamo in revit with the Node FamilyInstance.ByPoint
I know it is possible in revit.
But as far as i know it is not possible with dynamo to place it on af referenceplane and host is to that reference plane.
Have you had any luck with this, Jacob? I’ve tried this method in more recent versions and I always get the error “expected XYZ, got Reference” for the reference plane reference. Any ideas?
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('DSCoreNodes')
from DSCore import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
from Revit.Elements import *
clr.AddReference('System')
from System.Collections.Generic import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
refPlane = UnwrapElement(IN[0])
point = UnwrapElement(IN[1])
refDir = UnwrapElement(IN[2])
symbol = UnwrapElement(IN[3])
TransactionManager.Instance.EnsureInTransaction(doc)
newFam = doc.Create.NewFamilyInstance(refPlane.GetReference(),point,refDir,symbol)
TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable.
OUT = newFam
No rush on this either. If you have time to look at it, great, but it was just something I was trying out.
I believe because you weren’t constructing your point and vector as XYZs, that particular Create.NewFamilyInstance method was just not being recognized and was throwing a confusing error. The following works:
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
from Revit.Elements import *
clr.AddReference('System')
from System.Collections.Generic import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
refPlane = UnwrapElement(IN[0])
point = UnwrapElement(IN[1])
refDir = UnwrapElement(IN[2])
symbol = UnwrapElement(IN[3])
TransactionManager.Instance.EnsureInTransaction(doc)
newFam = doc.Create.NewFamilyInstance(refPlane.GetReference(), XYZ(point.X, point.Y, point.Z), XYZ(refDir.X,refDir.Y,refDir.Z), symbol)
TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable.
OUT = newFam
@jacob.small@Nick_Boyts@awilliams wel done as Always! I am going to test this tommorrow
Maybe of topic But is it also possible with structural framing?
EDIT: apologies @Nico_Stegeman that method doesn’t appear to work for the CurveDrivenStructural FamilyPlacementType… there might be another way, maybe reassigning the host after it is drawn
EDIT 2: Scratch that idea, the host property is also read-only… I’ll let you know if I think of anything else
I am using a very similar code, in fact, the only difference in my code is the variable names and some formatting.
But I am getting the error message:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 32, in
Exception: Error code: 5
I have changed my code to match your entirely. Bu added an iteration over a list to create multiple instances as I am populating a surface.
What is even weirder is the fact that this code was working fine.
I have rebooted my computer and have no Idea of what could possibly be happening.
I cannot find anywhere what error code 5 means and importing the traceback module fails. So I can’t read specifics on the exception.
that is my code:
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
from Revit.Elements import *
clr.AddReference('System')
from System.Collections.Generic import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
refPlane = UnwrapElement(IN[1])
points = UnwrapElement(IN[2])
refDir = UnwrapElement(IN[3])
symbol = UnwrapElement(IN[0])
TransactionManager.Instance.EnsureInTransaction(doc)
for point in points:
newFam = doc.Create.NewFamilyInstance(refPlane.GetReference(), XYZ(point.X, point.Y, point.Z), XYZ(refDir.X,refDir.Y,refDir.Z), symbol)
TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable.
OUT = newFam
Are you trying to use Dynamo Nodes or Python?
Can you upload a screen capture of your graph. I have been working something very similar and may be able to help