Hey Guys,
I’m trying to place a Column by using the dynamo node. While doing so i keep encountering this error:
Autodesk.Revit.Exceptions.InvalidOperationException: Instance of a level-based family cannot be created without a valid reference level.
at ?A0xa6a4641f.updateInstParamsForLevelRefFamily(ADocument* pADoc, FamilyInstance* pFamilyInstance, Boolean* structuralColumn, ElementId* levelId)
at ?A0xa6a4641f.addFamilyInstanceEx(ADocument* pADoc, Owner<FamilyInstance>* oFamilyInstance, Enum structuralType, ElementId* levelId, Boolean* shouldRegen, Boolean batchprocessing)
at Autodesk.Revit.Creation.addFamilyInstance(ADocument* pADoc, FamilyInstance* pFamilyInstance, Enum structuralType, Boolean* shouldRegen, ElementId* levelId)
at Autodesk.Revit.Creation.ItemFactoryBase.NewFamilyInstance(XYZ location, FamilySymbol symbol, Element host, StructuralType structuralType)
The code snippet i’m trying to use :
def processColumn(self, columnDict,level):
try:
xCoordinate = float(columnDict["origoPos"]["x"])*1000
yCoordinate = float(columnDict["origoPos"]["y"])*1000
zCoordinate = float(columnDict["origoPos"]["z"])*1000
basePoint=Point.ByCoordinates(xCoordinate,yCoordinate,zCoordinate)
symbol=columnDict["symbol"]
TransactionManager.Instance.EnsureInTransaction(self.doc)
symbol.Activate()
fam=self.doc.Create.NewFamilyInstance(basePoint.ToXyz(), symbol, level , StructuralType.Column)
TransactionManager.Instance.TransactionTaskDone()
return fam
except Exception as e:
return e
The inputparameters (basePoint, symbol, level,StructuralType.Column) seem to be valid. Does anybody know what the cause of this error could? Currently im using Revit 2023.1 with DYNAMO v.2.16.2 . Weird thing is that the columns do get placed:
But they don’t get assigned to the level:
The level im inputting is an actual existing level. I hope somebody could help me out here.