Placing custom family instances

Placing custom family instances

Anonymous
Not applicable
1,140 Views
3 Replies
Message 1 of 4

Placing custom family instances

Anonymous
Not applicable

Newbie question. I just started Revit API programming for a few days and have this noob question I want to ask. I have a custom family I created, let's say I have already loaded this family in my project, what i want to do now is to make an external command to automatically place said family onto a list of locations. My direction right now is to use the Create.NewFamilyInstance method, however, I do not know how to get the family symbol of the custom family. Is document.GetElement method the right way to approach this? Any help or suggestion is much appreciated, as I am new with the syntax of Revit Api and C#, a simple sample to follow would be wonderful.

 

Thanks

0 Likes
Accepted solutions (1)
1,141 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Message 3 of 4

stever66
Advisor
Advisor
Accepted solution

I think you have to go through all of the families with aa filtered element collector and check each one until you find the one with the name you want.  That seems to be a typical procedure for finding elements, views and parameters in revit.

 

it sounds a lot harder than it really is.  I have an example posted here:

 

https://sites.google.com/site/revitapi123/code-examples-april-15-2018

 

Message 4 of 4

Anonymous
Not applicable

Thank you for the prompt reply, your examples are awesome!!!!! I have one more question tho, my custom family belong to the Detail Items family, I would like to overload the FilteredEmelentColletor class with the .OfCategory method to lessen the element that pass the filter, but since the .OfClass method already in use I cannot do that. Can you show me a way to work around that?

0 Likes