HI @NZhouSNYLF
Revit API Family Hierarchy --> Family-->FamilySymbol-->FamilyInstance.
To Create a Family Instance, need to get the FamilySymbol. Kindly refer the below code for additional reference.
Reference Code:
//01. Filter the Family Symbol which you want to place
FamilySymbol symbol = new FilteredElementCollector(doc)
.OfClass(typeof(FamilySymbol))
.OfCategory(BuiltInCategory.OST_DetailComponents)
.Where(x => x.Name.Equals("Demo"))
.First() as FamilySymbol;
//02. Get Family of the Family Symbol
Family fam = symbol.Family;
//03. Get the Placement Type
FamilyPlacementType placementType = fam.FamilyPlacementType;
switch (placementType)
{
case FamilyPlacementType.Adaptive:
//Write your Instance Creation Logic
break;
case FamilyPlacementType.CurveBased:
//Write your Instance Creation Logic
break;
case FamilyPlacementType.WorkPlaneBased:
//Write your Instance Creation Logic
break;
default:
break;
}
While Posting questions, please write some description of the question, Only Links may confuse and misunderstand your question.
Hope this will Helps 🙂
thanks Mohamed, good to know that placement type can be retrieved directly from family instead of family document!
Can't find what you're looking for? Ask the community or share your knowledge.