Hi all!
I am trying to create beams at the location of walls getting the wall location for the lines.
Trying to use the NewFamilyInstance with the lines, familySymbol (I tried extracting symbol from beam in project as well as inputing familytype), level, and structural framing type - I am getting the following error:
no method matches arguments for NewFamilyInstance: autodesk.revit.db.line, autodesk.revit.db.familysymbol, autodesk.revit.db.level, revit.elements.familytype.
Is there a way around this?
Using the BeamsByCurve node the beams do work, though I would like to solve it through the custom api script.
import clr
import sys
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument
dynCurves = IN[0] if isinstance(IN[0],list) else [IN[0]]
famSymb = UnwrapElement(IN[1])
level = UnwrapElement(IN[2])[0]
structType = IN[3]
revBeams = []
dynBeams = []
#Begin transaction
try:
TransactionManager.Instance.EnsureInTransaction(doc)
for curv in dynCurves:
revCurv = curv.ToRevitType()
if not famSymb.IsActive:
famSymb.Activate()
newFam = doc.Create.NewFamilyInstance(revCurv,famSymb, level, structType)
revBeams.append(newFam)
dynBeams.append(newFam.ToProtoType())
#End transaction
finally:
TransactionManager.Instance.TransactionTaskDone
OUT = dynBeams,revBeams