Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66693

Re: having trouble programmatically placing doors and windows in walls, via an a

$
0
0

Oh, how unfortunate and confusing!  Here's a quick way to get Ids of all door family symbols.

 

using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace Revit.Examples
{
    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class TestCommand : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            var collector = new FilteredElementCollector(commandData.Application.ActiveUIDocument.Document);

            var doorFamilySymbolIds = collector.
                OfClass(typeof (FamilySymbol)).
                OfCategory(BuiltInCategory.OST_Doors).
                ToElementIds();

            return Result.Succeeded;
        }
    }
}

Viewing all articles
Browse latest Browse all 66693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>