- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, guys, I want to notify about a minor bug in the API.
FaceWall.Create throws Autodesk.Revit.Exceptions in a specific case:
1) you have a user mass family (not an in-placed one)
2) you created the family instance programmatically using NewFamilyInstance(XYZ, FamilySymbol, StructuralType) method
3) you want to create a face wall by the family instance face
To avoid this exception you should either:
- create a family with another NewFamilyInstance method overload, for example with NewFamilyInstance(XYZ, FamilySymbol, Level, StructuralType)
- fill "Schedule level" parameter
It seems, FaceWall.Create method internally tries to determine the level for a new FaceWall element (UI offers to select it) and fails if the level is not found. Meanwhile FaceWall.IsValidFaceReferenceForFaceWall method returns true.
So, apart from checking the results of IsValidFaceReferenceForFaceWall and IsWallTypeValidForFaceWall you should check if at least one of these conditions is met:
- face source element SCHEDULE_LEVEL_PARAM parameter value is not equal to ElementId.InvalidElementId
- face source element INSTANCE_SCHEDULE_ONLY_LEVEL_PARAM parameter value is not equal to ElementId.InvalidElementId
- face source element is an in-placed family instance
Affected versions: 2019-2021.
@jeremytammik , I think, the developer team should be aware of this minor bug as well as anyone who faced with it and could find a workaround here.
Solved! Go to Solution.