Hello, I am trying to place a family instance, following is my code snippet. My family is OneLevelBased but I am getting error on the instance creation line that a Curve is expected instead of a XYZ. Not sure how to resolve this.
if familyPlacementType == FamilyPlacementType.OneLevelBased or familyPlacementType == FamilyPlacementType.TwoLevelsBased :
if category == "Doors":
print(fname + " avoided placement: Curtain Wall Door avoided")
continue
if category == "Curtain Panels":
print(fname + " avoided placement: Curtain Panel avoided")
continue
p1 = p1 + XYZ(symbolWidth/2,0,0)
instance = doc.Create.NewFamilyInstance(p1,
ftype,
selectedLevel,
structuralType)
Hard to say without seeing how p1, ftype, selectedLevel, and structuralType are defined.
One of the inputs is wrong, and revit is displaying the Exception from the last ‘overload’ constructor that it tried and failed on.
Just a guess, but you may be passing in FamilySymbol.Id, or Level.Id instead of the full element itself.