Sets the default family type id for the given family category.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 26.4.0.0 (26.4.0.0)
Syntax
C#
public void SetDefaultFamilyTypeId(
ElementId familyCategoryId,
ElementId familyTypeId
)
Parameters
- familyCategoryId ElementId
-
The family category id.
- familyTypeId ElementId
-
The default family type id.
Exceptions
| Exception | Condition |
|---|
| ArgumentException |
The family type id familyTypeId is invalid for the give family category familyCategoryId.
-or-
familyCategoryId is not a built in category or parameter Element ID.
|
| ArgumentNullException |
A non-optional argument was null
|
Example
C#
private void SetDefaultTypeFromDoor(Document document, FamilyInstance door)
{
ElementId doorCategoryId = new ElementId(BuiltInCategory.OST_Doors);
if (door.Symbol.IsValidDefaultFamilyType(doorCategoryId))
{
document.SetDefaultFamilyTypeId(doorCategoryId, door.Symbol.Id);
}
}
VB
Private Sub SetDefaultTypeFromDoor(document As Document, door As FamilyInstance)
Dim doorCategoryId As New ElementId(BuiltInCategory.OST_Doors)
If door.Symbol.IsValidDefaultFamilyType(doorCategoryId) Then
document.SetDefaultFamilyTypeId(doorCategoryId, door.Symbol.Id)
End If
End Sub
See Also
Reference