Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to detect if family is line based in project document

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
NZhouSNYLF
186 Views, 2 Replies

How to detect if family is line based in project document

2 REPLIES 2
Message 2 of 3
Mohamed_Arshad
in reply to: NZhouSNYLF

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 & Regards,
Mohamed Arshad K
Message 3 of 3
NZhouSNYLF
in reply to: NZhouSNYLF

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.

Post to forums  

Rail Community


Autodesk Design & Make Report