Autodesk Revit API
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Place Repeating Detail Again
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Working on my first batch of programming with the API. Hit my first question that I cannot answer with Google.
I am trying to place a repeating detail. I read this
http://forums.autodesk.com/t5/Autodesk-Revit-API/P
And it mostly made sense. The problem is, in the code sample it says "// fine (sic) the family symbol here" as a comment in the code. I cannot figure out how to pick the family symbol I want.
I've spent a lot of time with FamilySymbol, but no luck.
Any guidance on selecting the symbol I want to use? And feel free to speak slowly. Like I said, this is my first dive in the Revit API. Thanks.
Re: Place Repeating Detail Again
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I'm not 100% if this is what you are looking for but here it is. A sample code searching a family symbol based on category and name. Code is C++/CLI but its somewhat similar with the C#
List<FamilySymbol^>^ familySymbols(Document^ document,
BuiltInCategory category,
String^ name)
{
// Filters
ElementCategoryFilter ^categoryFilter = gcnew ElementCategoryFilter(category);
ElementClassFilter ^classFilter = gcnew ElementClassFilter(FamilySymbol::typeid);
LogicalAndFilter ^lFilter = gcnew LogicalAndFilter(categoryFilter, classFilter);
// Elements lookup
FilteredElementCollector ^elementCollector = gcnew FilteredElementCollector(document);
elementCollector->WherePasses(lFilter);
// Find correct element and cast it to FamilySymbol
List<FamilySymbol^> ^familyList = gcnew List<FamilySymbol^>;
for each (Element ^elem in elementCollector)
{
FamilySymbol ^familySymbol = safe_cast<FamilySymbol^>(elem);
if(familySymbol->Family->Name->Equals(name)
{
familyList->Add(familySymbol);
}
}
return familyList;
}
Re: Place Repeating Detail Again
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks. After some c# massagin, it does precisely what I wanted it to do.
Of course, after much pacing, I think I am realizing that I am not knowledgeable enough to know what I really need this to do.
Maybe I should back up and ask everyone, is it even possible to place a Repeating Detail with the API? With the above poster's help, I have been able to place single detail component and a line-based detail component, but no Repeating Detail. I have used different BuiltInCategories, different overloads of the NewFamilyInstance, but no dice.
So, is placing a Repeating Detail even possible?

