Nice3point.Revit.Extensions 2027.0.0

Prefix Reserved
dotnet add package Nice3point.Revit.Extensions --version 2027.0.0
                    
NuGet\Install-Package Nice3point.Revit.Extensions -Version 2027.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nice3point.Revit.Extensions" Version="2027.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nice3point.Revit.Extensions" Version="2027.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Nice3point.Revit.Extensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nice3point.Revit.Extensions --version 2027.0.0
                    
#r "nuget: Nice3point.Revit.Extensions, 2027.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nice3point.Revit.Extensions@2027.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nice3point.Revit.Extensions&version=2027.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Nice3point.Revit.Extensions&version=2027.0.0
                    
Install as a Cake Tool

Improve your experience with Revit API

Nuget Downloads Last Commit

Extensions make working with the Revit API much easier and more intuitive. They add helpful methods that make your code cleaner, easier to understand, and simpler to maintain. Generics, nullable, everything here.

Instead of writing complex utility functions, you can use these extensions to write code in a natural, fluent way that focuses on what you actually want to do:

new ElementId(123469)
    .ToElement<Wall>()
    .FindParameter(ParameterTypeId.WallBaseOffset)
    .AsDouble()
    .ToMillimeters()
    .Round();

Installation

You can install the Extensions as a NuGet package.

The packages are compiled for specific versions of Revit. To support different versions of libraries in one project, use the RevitVersion property:

<PackageReference Include="Nice3point.Revit.Extensions" Version="$(RevitVersion).*"/>

Package included by default in Revit Templates.

Table of contents

Element

ToElement retrieves the element associated with the specified ElementId.

Element element = wallId.ToElement(document);
Wall wall = wallId.ToElement<Wall>(document);

ToElements retrieves a collection of elements associated with the specified ElementIds.

IList<Element> elements = wallIds.ToElements(document);
IList<Wall> walls = wallIds.ToElements<Wall>(document);

To improve database access performance, it is not guaranteed that the elements will be retrieved in the original order. If you need the same order, use the ToOrderedElements extension.

ToOrderedElements retrieves the elements associated with the specified ElementIds in their original order.

IList<Element> elements = wallIds.ToOrderedElements(document);
IList<Wall> walls = wallIds.ToOrderedElements<Wall>(document);

CanBeDeleted indicates whether an element can be deleted.

var canDelete = element.CanBeDeleted;
var canDelete = elementId.CanBeDeleted(document);

FindParameter finds a parameter in the instance or symbol by identifier. For instances that do not have such a parameter, this method will find and return it at the element type. This method combines all API methods for getting a parameter into one, such as get_Parameter, LookupParameter, GetParameter.

var parameter = element.FindParameter(ParameterTypeId.AllModelUrl);
var parameter = element.FindParameter(BuiltInParameter.ALL_MODEL_URL);
var parameter = element.FindParameter(guid);
var parameter = element.FindParameter("URL");

Transformation

Copy copies an element and places the copy at a location indicated by a given transformation.

element.Copy(1, 1, 0);
element.Copy(new XYZ(1, 1, 0));
elementId.Copy(document, 1, 1, 0);
elementId.Copy(document, new XYZ(1, 1, 0));

Mirror creates a mirrored copy of an element about a given plane.

element.Mirror(plane);
elementId.Mirror(document, plane);

Move moves the element by the specified vector.

element.Move(1, 1, 0);
element.Move(new XYZ(1, 1, 0));
elementId.Move(document, 1, 1, 0);
elementId.Move(document, new XYZ(1, 1, 0));

Rotate rotates an element about the given axis and angle.

element.Rotate(axis, angle);
elementId.Rotate(document, axis, angle);

CanBeMirrored determines whether an element or a set of elements can be mirrored.

var canMirror = element.CanBeMirrored;
var canMirror = elementId.CanBeMirrored(document);
var canMirror = elementIds.CanBeMirrored(document);

MirrorElements mirrors a set of elements about a given plane.

var elements = elementIds.MirrorElements(document, plane, mirrorCopies: true);

MoveElements moves a set of elements by a given transformation.

elementIds.MoveElements(document, new XYZ(1, 1, 1));

RotateElements rotates a set of elements about the given axis and angle.

elementIds.RotateElements(document, axis, angle: 3.14);

CopyElements copies elements within a document, between views, or between documents.

var viewCopy = elementIds.CopyElements(sourceView, destinationView);
var viewCopy = elementIds.CopyElements(sourceView, destinationView, transform, options);

var translatedCopy = elementIds.CopyElements(document, new XYZ(1, 1, 1));

var documentCopy = elementIds.CopyElements(sourceDocument, destinationDocument);
var documentCopy = elementIds.CopyElements(sourceDocument, destinationDocument, transform, options);

Joins and cuts

JoinGeometry creates clean joins between two elements that share a common face.

element1.JoinGeometry(element2);

UnjoinGeometry removes a join between two elements.

element1.UnjoinGeometry(element2);

AreElementsJoined determines whether two elements are joined.

var areJoined = element1.AreElementsJoined(element2);

GetJoinedElements returns all elements joined to a given element.

var elements = element1.GetJoinedElements();

SwitchJoinOrder reverses the order in which two elements are joined.

element1.SwitchJoinOrder(element2);

IsCuttingElementInJoin determines whether the first of two joined elements is cutting the second.

var isCutting = element1.IsCuttingElementInJoin(element2);

CanBeCutWithVoid indicates if the element can be cut by an instance with unattached voids.

var canBeCut = element.CanBeCutWithVoid;

GetCuttingVoidInstances returns ids of the instances with unattached voids cutting the element.

var ids = element.GetCuttingVoidInstances();

AddInstanceVoidCut adds a cut to an element using the unattached voids inside a cutting instance.

element.AddInstanceVoidCut(cuttingInstance);

RemoveInstanceVoidCut removes a cut applied to the element by a cutting instance.

element.RemoveInstanceVoidCut(cuttingInstance);

IsInstanceVoidCutExists checks whether the instance is cutting the element.

var exists = element.IsInstanceVoidCutExists(cuttingInstance);

Extensible storage

SaveEntity stores data in the element. Existing data is overwritten.

document.ProjectInformation.SaveEntity(schema, "data", "schemaField");
door.SaveEntity(schema, "white", "doorColorField");

LoadEntity retrieves the value stored in the schema from the element.

var data = document.ProjectInformation.LoadEntity<string>(schema, "schemaField");
var color = door.LoadEntity<string>(schema, "doorColorField");

Application extensions

AsControlledApplication creates a ControlledApplication from the current Application instance. This allows using APIs that require a ControlledApplication outside of the IExternalDBApplication.OnStartup context.

var controlledApplication = application.AsControlledApplication();

IsDgnExportAvailable and other optional functionality extensions expose whether optional Revit modules are installed.

var available = application.IsDgnExportAvailable;
var available = application.IsDgnImportLinkAvailable;
var available = application.IsDwfExportAvailable;
var available = application.IsDwgExportAvailable;
var available = application.IsDwgImportLinkAvailable;
var available = application.IsDxfExportAvailable;
var available = application.IsFbxExportAvailable;
var available = application.IsGraphicsAvailable;
var available = application.IsIfcAvailable;
var available = application.IsNavisworksExporterAvailable;
var available = application.IsSatImportLinkAvailable;
var available = application.IsShapeImporterAvailable;
var available = application.IsSkpImportLinkAvailable;
var available = application.Is3DmImportLinkAvailable;
var available = application.IsAxmImportLinkAvailable;
var available = application.IsObjImportLinkAvailable;
var available = application.IsStlImportLinkAvailable;
var available = application.IsStepImportLinkAvailable;
var available = application.IsMaterialLibraryAvailable;

GetAllCloudRegions gets all available regions supported by the cloud service.

var regions = application.GetAllCloudRegions();

UIApplication extensions

AsControlledApplication creates a UIControlledApplication from the current UIApplication instance. This allows using APIs that require a UIControlledApplication, such as ribbon customization, outside of the IExternalApplication.OnStartup context.

var controlledApplication = uiApplication.AsControlledApplication();

Ribbon

Revit API Ribbon controls Guidelines

CreatePanel creates or retrieves an existing panel in the "Add-ins" tab of the Revit ribbon.

If a panel with the specified name already exists within the tab, it will return that panel; otherwise, a new one will be created.

Adding a panel also supports built-in tabs. To add a panel to the built-in Revit tab, specify the panel ID or Name as the tabName parameter.

var panel = application.CreatePanel("Panel name");
var panel = application.CreatePanel("Panel name", "Tab name");

regularControls

RemovePanel removes a RibbonPanel from the Revit ribbon.

panel.RemovePanel();

AddPushButton adds a PushButton to the ribbon.

var button = panel.AddPushButton<Command>("Button text");
var button = pullDownButton.AddPushButton<Command>("Button text");

AddPullDownButton adds a PullDownButton to the ribbon.

var button = panel.AddPullDownButton("Button text");

AddSplitButton adds a SplitButton to the ribbon.

var button = panel.AddSplitButton("Button text");

AddRadioButtonGroup adds a RadioButtonGroup to the ribbon.

var radioGroup = panel.AddRadioButtonGroup();

AddComboBox adds a ComboBox to the ribbon.

var comboBox = panel.AddComboBox();

AddTextBox adds a TextBox to the ribbon.

var textBox = panel.AddTextBox();

SetImage adds an image to the RibbonButton.

button.SetImage("/RevitAddIn;component/Resources/Icons/RibbonIcon16.png");
button.SetImage("https://example.com/RibbonIcon16.png");
button.SetImage("C:/Pictures/RibbonIcon16.png");

SetLargeImage adds a large image to the RibbonButton.

button.SetLargeImage("/RevitAddIn;component/Resources/Icons/RibbonIcon32.png");
button.SetLargeImage("https://example.com/RibbonIcon32.png");
button.SetLargeImage("C:/Pictures/RibbonIcon32.png");

Starting with Revit 2024 SetImage and SetLargeImage extensions support Light and Dark UI themes.

When the provided image name contains "light" or "dark" (case-insensitive), the extensions automatically modify the URI to match the current UI theme. For example:

button.SetImage("/RevitAddIn;component/Resources/Icons/RibbonIcon16-Light.png");
button.SetImage("/RevitAddIn;component/Resources/Icons/RibbonIcon16_light.png");

// in the Dark Revit theme will be converted to:
button.SetImage("/RevitAddIn;component/Resources/Icons/RibbonIcon16-Dark.png");
button.SetImage("/RevitAddIn;component/Resources/Icons/RibbonIcon16_dark.png");

SetToolTip sets the tooltip text for the RibbonItem.

button.SetToolTip("Tooltip");

SetLongDescription sets the extended tooltip description for the RibbonItem.

button.SetLongDescription("Description");

SetAvailabilityController specifies the class that decides the availability of a PushButton.

pushButton.SetAvailabilityController<CommandController>();

AddShortcuts adds keyboard shortcuts to the PushButton.

pushButton.AddShortcuts("RE");
pushButton.AddShortcuts("RE#NP");
pushButton.AddShortcuts("RE", "NP");
pushButton.AddShortcuts(["RE", "NP"]);
pushButton.AddShortcuts(new List<string>() {"RE", "NP"});

The method is intended to add only the default shortcut assignment, and does not override the user's settings if they decide to change it.

TryAddShortcuts attempts to add keyboard shortcuts to the PushButton. Shortcuts are added only if they do not conflict with existing commands.

var isAdded = pushButton.TryAddShortcuts("RE");
var isAdded = pushButton.TryAddShortcuts("RE#NP");
var isAdded = pushButton.TryAddShortcuts("RE", "NP");
var isAdded = pushButton.TryAddShortcuts(["RE", "NP"]);
var isAdded = pushButton.TryAddShortcuts(new List<string>() {"RE", "NP"});

AddStackPanel adds a vertical stack panel to the Ribbon panel.

var stackPanel = panel.AddStackPanel();

By default, the StackPanel accommodates one to three elements vertically. If the added items exceed the maximum threshold, they will be automatically added to a new column.

These 5 items will create 2 vertical panels, one will contain 3 items and the other 2 items:

var stackPanel = panel.AddStackPanel();
stackPanel.AddPushButton<StartupCommand>("Execute");
stackPanel.AddPullDownButton("Execute");
stackPanel.AddSplitButton("Execute");
stackPanel.AddLabel("Items:");
stackPanel.AddComboBox();
stackPanel.AddTextBox();

verticalStack

SetBackground sets the panel background color.

panel.SetBackground("Red");
panel.SetBackground("#FF0000");
panel.SetBackground("#AAFF0000");
panel.SetBackground(Colors.Red);
panel.SetBackground(Brushes.Red);
panel.SetBackground(new LinearGradientBrush(
[
    new GradientStop(Colors.White, 0),
    new GradientStop(Colors.Red, 1)
], 45));

SetTitleBarBackground sets the panel title bar background color.

panel.SetTitleBarBackground("Blue");
panel.SetTitleBarBackground("#0000FF");
panel.SetTitleBarBackground(Colors.Blue);
panel.SetTitleBarBackground(Brushes.Blue);

SetSlideOutPanelBackground sets the slide-out panel background color.

panel.SetSlideOutPanelBackground("Green");
panel.SetSlideOutPanelBackground("#00FF00");
panel.SetSlideOutPanelBackground(Colors.Green);
panel.SetSlideOutPanelBackground(Brushes.Green);

Context menu

ConfigureContextMenu registers an action used to configure a Context menu.

application.ConfigureContextMenu(menu =>
{
    menu.AddMenuItem<Command>("Menu title");
    menu.AddMenuItem<Command>("Menu title")
        .SetAvailabilityController<Controller>()
        .SetToolTip("Description");
});

You can also specify your own context menu title. By default, Revit uses the Application name.

application.ConfigureContextMenu("Title", menu =>
{
    menu.AddMenuItem<Command>("Menu title");
});

AddMenuItem adds a menu item to the Context Menu.

menu.AddMenuItem<Command>("Menu title");

AddSeparator adds a separator to the Context Menu.

menu.AddSeparator();

AddSubMenu adds a sub menu to the Context Menu.

var subMenu = new ContextMenu();
subMenu.AddMenuItem<Command>("Menu title");
subMenu.AddMenuItem<Command>("Menu title");

menu.AddSubMenu("Sub menu title", subMenu);

SetAvailabilityController specifies the class type that decides the availability of a menu item.

menuItem.SetAvailabilityController<Controller>();

Document

Version gets the DocumentVersion that corresponds to a document.

var version = document.Version;

IsValidVersionGuid checks whether the GUID is valid for the given document.

var isValid = document.IsValidVersionGuid(versionGuid);

CheckAllFamilies checks that all families loaded in the host document have their content documents.

var isValid = document.CheckAllFamilies(out var corruptFamilyIds);

CheckAllFamiliesSlow checks integrity of content documents of all families loaded in the host document. This check is slow as it involves traversal of all content documents.

var isValid = document.CheckAllFamiliesSlow(out var corruptFamilyIds);

Global parameters

FindGlobalParameter finds a global parameter with the given name in the document.

var parameter = document.FindGlobalParameter(name);

GetAllGlobalParameters returns all global parameters available in the given document.

var parameters = document.GetAllGlobalParameters();

GetGlobalParametersOrdered returns all global parameters in an ordered array.

var parameters = document.GetGlobalParametersOrdered();

SortGlobalParameters sorts global parameters in the desired order.

document.SortGlobalParameters(ParametersOrder.Ascending);

MoveUpOrder moves the given global parameter Up in the current order.

var isMoved = globalParameter.MoveUpOrder();
var isMoved = globalParameterId.MoveGlobalParameterUpOrder(document);

MoveDownOrder moves the given global parameter Down in the current order.

var isMoved = globalParameter.MoveDownOrder();
var isMoved = globalParameterId.MoveGlobalParameterDownOrder(document);

IsUniqueGlobalParameterName tests whether a name is unique among existing global parameters of a given document.

var isUnique = document.IsUniqueGlobalParameterName(name);

IsValidGlobalParameter tests whether an ElementId is of a global parameter in the given document.

var isValid = parameterId.IsValidGlobalParameter(document);

AreGlobalParametersAllowed tests whether global parameters are allowed in the given document.

var isAllowed = document.AreGlobalParametersAllowed;

Managers and services

GetTemporaryGraphicsManager gets a TemporaryGraphicsManager reference of the document.

var manager = document.GetTemporaryGraphicsManager();

GetAnalyticalToPhysicalAssociationManager gets an AnalyticalToPhysicalAssociationManager reference of the document.

var manager = document.GetAnalyticalToPhysicalAssociationManager();

GetLightGroupManager creates a light group manager object from the given document.

var manager = document.GetLightGroupManager();

Parameters

AsBool provides access to the boolean value within the parameter.

bool value = element.FindParameter("IsClosed").AsBool();

AsColor provides access to the Color within the parameter.

Color value = element.FindParameter("Door color").AsColor();

AsElement provides access to the Element within the parameter.

Element value = element.FindParameter("Door material").AsElement();
Material value = element.FindParameter("Door material").AsElement<Material>();

Set sets the parameter to a new value.

parameter.Set(true);
parameter.Set(new Color(66, 69, 96));

SearchExternalDefinition searches a DefinitionFile for the ExternalDefinition corresponding to a parameter in a document.

var definition = definitionFile.SearchExternalDefinition(document, parameterId);
var definition = definitionFile.SearchExternalDefinition(parameter);

BuiltInParameter

IsBuiltInParameter checks whether a ForgeTypeId identifies a built-in parameter.

var isBuiltIn = forgeId.IsBuiltInParameter;
var isBuiltIn = parameter.IsBuiltInParameter;

ToParameter converts a BuiltInParameter into a Revit Parameter object.

var parameter = BuiltInParameter.WALL_TOP_OFFSET.ToParameter(document);

ToElementId creates an ElementId from a BuiltInParameter value.

var elementId = BuiltInParameter.WALL_TOP_OFFSET.ToElementId();

IsParameter checks if an ElementId matches a BuiltInParameter.

var isParameter = parameterId.IsParameter(BuiltInParameter.WALL_BOTTOM_IS_ATTACHED);

Filtering

GetAllFilterableCategories returns the set of categories that may be used in a ParameterFilterElement.

var categories = ParameterFilterElement.GetAllFilterableCategories();

GetFilterableParametersInCommon returns the filterable parameters common to the given categories.

var parameters = ParameterFilterElement.GetFilterableParametersInCommon(document, categories);

IsParameterApplicable determines whether the element supports the given parameter.

var applicable = element.IsParameterApplicable(parameterId);
var applicable = element.IsParameterApplicable(parameter);

RemoveUnfilterableCategories removes from the given set the categories that are not filterable.

var filtered = categories.RemoveUnfilterableCategories();

GetInapplicableParameters returns the parameters that are not among the set of filterable parameters common to the given categories.

var invalid = ParameterFilterElement.GetInapplicableParameters(document, categories, parameters);

Category

BuiltInCategory

ToCategory converts a BuiltInCategory into a Revit Category object.

var category = BuiltInCategory.OST_Walls.ToCategory(document);

ToElementId creates an ElementId from a BuiltInCategory value.

var elementId = BuiltInCategory.OST_Walls.ToElementId();

IsCategory checks if an ElementId matches a BuiltInCategory.

var isWalls = categoryId.IsCategory(BuiltInCategory.OST_Walls);

Geometry

Distance returns the distance between two lines. The lines are considered endless.

var line1 = Line.CreateBound(new XYZ(0, 0, 1), new XYZ(1, 1, 1));
var line2 = Line.CreateBound(new XYZ(1, 2, 2), new XYZ(1, 2, 2));
var distance = line1.Distance(line2);

Bounding box

ComputeCentroid computes the geometric center point of the bounding box.

var center = boundingBox.ComputeCentroid();

ComputeVertices retrieves the coordinates of the eight vertices that define the bounding box.

var vertices = boundingBox.ComputeVertices();

ComputeVolume calculates the volume enclosed by the bounding box.

var volume = boundingBox.ComputeVolume();

ComputeSurfaceArea calculates the total surface area of the bounding box.

var area = boundingBox.ComputeSurfaceArea();

Contains determines whether a bounding box contains a point or another bounding box.

var containsPoint = boundingBox.Contains(new XYZ(1, 1, 1));
var containsPoint = boundingBox.Contains(new XYZ(1, 1, 1), strict: true);

var containsBox = boundingBox1.Contains(boundingBox2);
var containsBox = boundingBox1.Contains(boundingBox2, strict: true);

Overlaps determines whether this BoundingBox overlaps with another BoundingBox.

var overlaps = boundingBox1.Overlaps(boundingBox2);

Curve

SetCoordinateX creates an instance of a curve with a new X coordinate.

var newLine = line.SetCoordinateX(1);
var newArc = arc.SetCoordinateX(1);

SetCoordinateY creates an instance of a curve with a new Y coordinate.

var newLine = line.SetCoordinateY(1);
var newArc = arc.SetCoordinateY(1);

SetCoordinateZ creates an instance of a curve with a new Z coordinate.

var newLine = line.SetCoordinateZ(1);
var newArc = arc.SetCoordinateZ(1);

SetX creates an instance of a point with a new X coordinate.

var newPoint = point.SetX(1);

SetY creates an instance of a point with a new Y coordinate.

var newPoint = point.SetY(1);

SetZ creates an instance of a point with a new Z coordinate.

var newPoint = point.SetZ(1);

GetHostFace gets the host face to which the CurveElement is added.

var reference = curveElement.GetHostFace();

GetProjectionType gets the projection type of the CurveElement.

var type = curveElement.GetProjectionType();

SetProjectionType sets the projection type of the CurveElement.

curveElement.SetProjectionType(CurveProjectionType.FromTopDown);

GetSketchOnSurface gets the relationship between the CurveElement and face.

var sketchOnSurface = curveElement.GetSketchOnSurface();

SetSketchOnSurface sets the relationship between the CurveElement and face.

curveElement.SetSketchOnSurface(sketchOnSurface: true);

CreateArcThroughPoints creates an arc through the given reference points.

var arc = CurveElement.CreateArcThroughPoints(document, startPoint, endPoint, interiorPoint);

AddCurvesToFaceRegion adds CurveElements to one or more FaceRegions.

CurveElement.AddCurvesToFaceRegion(document, curveElementIds);

CreateRectangle creates a rectangle on a face or sketchplane for two given diagonal points.

CurveElement.CreateRectangle(document, startPoint, endPoint, projectionType, boundaryReferenceLines, boundaryCurvesFollowSurface, out createdCurvesIds, out createdCornersIds);

ValidateForFaceRegions validates that the input CurveElements can define FaceRegions.

var isValid = CurveElement.ValidateForFaceRegions(document, curveElemIds);

IsValidHorizontalBoundary identifies whether the given curve loops compose a valid horizontal boundary.

var isValid = CurveLoop.IsValidHorizontalBoundary(curveLoops);

IsValidBoundaryOnSketchPlane indicates if the given curve loops compose a valid boundary on the sketch plane.

var isValid = CurveLoop.IsValidBoundaryOnSketchPlane(sketchPlane, curveLoops);

IsValidBoundaryOnView indicates if the given curve loops compose a valid boundary on the view's detail sketch plane.

var isValid = CurveLoop.IsValidBoundaryOnView(document, viewId, curveLoops);

GetFaceRegions gets the FaceRegions in the existing face.

var regions = reference.GetFaceRegions(document);

Solid

IsNonSolid makes sure that the input geometry object is not a Solid.

var isNonSolid = geometry.IsNonSolid;

IsSolid makes sure that the input geometry object is a Solid.

var isSolid = geometry.IsSolid;

Clone creates a new Solid which is a copy of the input Solid.

var clone = solid.Clone();

CreateTransformed creates a new Solid which is the transformation of the input Solid.

var transformed = solid.CreateTransformed(Transform.CreateRotationAtPoint());

CreateBlendGeometry creates a solid by blending two closed curve loops.

var solid = Solid.CreateBlendGeometry(firstLoop, secondLoop);
var solid = Solid.CreateBlendGeometry(firstLoop, secondLoop, vertexPairs);

CreateExtrusionGeometry creates a solid by linearly extruding one or more closed coplanar curve loops.

var solid = Solid.CreateExtrusionGeometry(profileLoops, extrusionDirection, extrusionDistance);

CreateRevolvedGeometry creates a solid of revolution by revolving a set of closed curve loops around an axis.

var solid = Solid.CreateRevolvedGeometry(coordinateFrame, profileLoops, startAngle, endAngle);

CreateSweptGeometry creates a solid by sweeping one or more closed coplanar curve loops along a path.

var solid = Solid.CreateSweptGeometry(sweepPath, pathAttachmentCurveIndex, pathAttachmentParameter, profileLoops);

CreateSweptBlendGeometry creates a solid by simultaneously sweeping and blending two or more closed planar curve loops along a single curve.

var solid = Solid.CreateSweptBlendGeometry(pathCurve, pathParameters, profileLoops, vertexPairs);

CreateFixedReferenceSweptGeometry creates a solid by sweeping curve loops along a path while keeping the profile plane oriented to a fixed direction.

var solid = Solid.CreateFixedReferenceSweptGeometry(sweepPath, pathAttachmentCurveIndex, pathAttachmentParameter, profileLoops, fixedReferenceDirection);

CreateLoftGeometry creates a solid or open shell geometry by lofting between a sequence of curve loops.

var solid = Solid.CreateLoftGeometry(profileLoops, solidOptions);

ComputeIsGeometricallyClosed computes whether the Solid is geometrically closed to within Revit's tolerances.

var closed = solid.ComputeIsGeometricallyClosed(profileLoops, solidOptions);

ComputeIsTopologicallyClosed computes whether the Solid is is topologically closed.

var closed = solid.ComputeIsTopologicallyClosed(profileLoops, solidOptions);

SplitVolumes splits a solid geometry into several separate solids.

var solids = solid.SplitVolumes();

CutWithHalfSpace creates a new Solid which is the intersection of the input Solid with the half-space on the positive side of the given Plane.

var result = solid.CutWithHalfSpace(plane);

CutWithHalfSpaceModifyingOriginalSolid modifies the input Solid preserving only the volume on the positive side of the given Plane.

solid.CutWithHalfSpaceModifyingOriginalSolid(plane);

ExecuteBooleanOperation performs a boolean geometric operation between two solids and returns a new solid.

var result = solid.ExecuteBooleanOperation(other, BooleanOperationsType.Union);
var result = solid.ExecuteBooleanOperation(other, BooleanOperationsType.Intersect);
var result = solid.ExecuteBooleanOperation(other, BooleanOperationsType.Difference);

ExecuteBooleanOperationModifyingOriginalSolid performs a boolean operation modifying the original solid.

solid.ExecuteBooleanOperationModifyingOriginalSolid(other, BooleanOperationsType.Union);

GetCuttingSolids gets all the solids which cut the input element.

var solids = element.GetCuttingSolids();

GetSolidsBeingCut gets all the solids which are cut by the input element.

var solids = element.GetSolidsBeingCut();

IsAllowedForSolidCut validates that the element is eligible for a solid-solid cut.

var isAllowed = element.IsAllowedForSolidCut;

IsElementFromAppropriateContext validates that the element is from an appropriate document.

var fromContext = element.IsElementFromAppropriateContext;

CanElementCutElement verifies if the cutting element can add a solid cut to the target element.

var canCut = element1.CanElementCutElement(element2, out var reason);

CutExistsBetweenElements checks if there is a solid-solid cut between two elements.

var exists = element1.CutExistsBetweenElements(element2, out var firstCutsSecond);

AddCutBetweenSolids adds a solid-solid cut for the two elements.

element1.AddCutBetweenSolids(element2);
element1.AddCutBetweenSolids(element2, splitFacesOfCuttingSolid: true);

RemoveCutBetweenSolids removes the solid-solid cut between the two elements.

element1.RemoveCutBetweenSolids(element2);

SplitFacesOfCuttingSolid causes the faces of the cutting element to be split or unsplit.

element1.SplitFacesOfCuttingSolid(element2, split: true);

Tessellation

IsValidForTessellation tests if the input solid or shell is valid for tessellation.

var isValid = solid.IsValidForTessellation;

TessellateSolidOrShell facets (triangulates) a solid or an open shell.

var tessellation = solid.TessellateSolidOrShell(tessellationControls);

ConvertTrianglesToQuads replaces pairs of adjacent, coplanar triangles by quadrilaterals.

var facets = triangulation.ConvertTrianglesToQuads();

FindAllEdgeEndPointsAtVertex finds all EdgeEndPoints at a vertex identified by the input EdgeEndPoint.

var points = edgeEndPoint.FindAllEdgeEndPointsAtVertex();

View

GetTransformFromViewToView returns a transformation that is applied to elements when copying from one view to another view.

var transform = view1.GetTransformFromViewToView(view2);

GetReferencedViewId gets the id of the view referenced by a reference view.

var viewId = element.GetReferencedViewId();
var viewId = elementId.GetReferencedViewId(document);

ChangeReferencedView changes a reference view to refer to a different View.

element.ChangeReferencedView(desiredViewId);
elementId.ChangeReferencedView(document, desiredViewId);

SSE point

GetSsePointVisibility gets the SSE point visibility for the given category.

var isVisible = category.GetSsePointVisibility(document);

SetSsePointVisibility sets the SSE point visibility for the given category.

category.SetSsePointVisibility(document, isVisible: true);

Spatial field

CreateSpatialFieldManager creates a SpatialFieldManager for the given view.

var manager = view.CreateSpatialFieldManager(numberOfMeasurements: 69);

GetSpatialFieldManager retrieves the SpatialFieldManager for the given view.

var manager = view.GetSpatialFieldManager();

Unit

FromMillimeters converts millimeters to internal Revit format (feet).

var value = 69d.FromMillimeters(); // 0.226

ToMillimeters converts a Revit internal format value (feet) to millimeters.

var value = 69d.ToMillimeters(); // 21031

FromMeters converts meters to internal Revit format (feet).

var value = 69d.FromMeters(); // 226.377

ToMeters converts a Revit internal format value (feet) to meters.

var value = 69d.ToMeters(); // 21.031

FromInches converts inches to internal Revit format (feet).

var value = 69d.FromInches(); // 5.750

ToInches converts a Revit internal format value (feet) to inches.

var value = 69d.ToInches(); // 827.999

FromDegrees converts degrees to internal Revit format (radians).

var value = 69d.FromDegrees(); // 1.204

ToDegrees converts a Revit internal format value (radians) to degrees.

var value = 69d.ToDegrees(); // 3953

FromUnit converts the specified unit type to internal Revit format.

var value = 69d.FromUnit(UnitTypeId.Celsius); // 342.15

ToUnit converts a Revit internal format value to the specified unit type.

var value = 69d.ToUnit(UnitTypeId.Celsius); // -204.15

Formatting

Format formats a number with units into a string.

var value = document.GetUnits().Format(SpecTypeId.Length, 69, forEditing: false); // 21031
var value = document.GetUnits().Format(SpecTypeId.Length, 69, forEditing: false, new FormatValueOptions {AppendUnitSymbol = true}); // 21031 mm

TryParse parses a formatted string into a number with units if possible.

var isParsed = document.GetUnits().TryParse(SpecTypeId.Length, "21031 mm", out var value); // 69

ForgeTypeId

IsBuiltInGroup checks whether a ForgeTypeId identifies a built-in parameter group.

var isGroup = forgeId.IsBuiltInGroup;

IsSpec checks whether a ForgeTypeId identifies a spec.

var isSpec = forgeId.IsSpec;

IsValidDataType returns true if the given ForgeTypeId identifies a valid parameter data type.

var isValid = forgeId.IsValidDataType;

IsSymbol checks whether a ForgeTypeId identifies a symbol.

var isSymbol = symbolTypeId.IsSymbol;

IsUnit checks whether a ForgeTypeId identifies a unit.

var isUnit = unitTypeId.IsUnit;

IsMeasurableSpec checks whether a ForgeTypeId identifies a spec associated with units of measurement.

var isMeasurable = specTypeId.IsMeasurableSpec;

IsValidUnit checks whether a unit is valid for a given measurable spec.

var isValid = specTypeId.IsValidUnit(unitTypeId);

GetBuiltInParameter gets the BuiltInParameter value corresponding to a built-in parameter identified by the given ForgeTypeId.

var builtInParameter = forgeId.GetBuiltInParameter();

GetBuiltInParameterGroupTypeId gets the parameter group identifier corresponding to the given built-in parameter identifier.

var builtInParameterGroup = forgeId.GetBuiltInParameterGroupTypeId();

GetAllBuiltInParameters gets the identifiers of all built-in parameters.

var ids = ForgeTypeId.GetAllBuiltInParameters();

GetAllBuiltInGroups gets the identifiers of all built-in parameter groups.

var ids = ForgeTypeId.GetAllBuiltInGroups();

GetAllSpecs gets the identifiers of all specs.

var ids = ForgeTypeId.GetAllSpecs();

GetAllMeasurableSpecs gets the identifiers of all available measurable specs.

var ids = ForgeTypeId.GetAllMeasurableSpecs();

GetAllDisciplines gets the identifiers of all available disciplines.

var ids = ForgeTypeId.GetAllDisciplines();

GetAllUnits gets the identifiers of all available units.

var ids = ForgeTypeId.GetAllUnits();

GetParameterTypeId gets the ForgeTypeId identifying the built-in parameter corresponding to the given BuiltInParameter value.

var forgeId = builtInParameter.GetParameterTypeId();

GetDiscipline gets the discipline for a given measurable spec.

var disciplineId = specTypeId.GetDiscipline();

GetValidUnits gets the identifiers of all valid units for a given measurable spec.

var unitIds = specTypeId.GetValidUnits();

GetTypeCatalogStringForSpec gets the string used in type catalogs to identify a given measurable spec.

var catalog = specTypeId.GetTypeCatalogStringForSpec();

GetTypeCatalogStringForUnit gets the string used in type catalogs to identify a given unit.

var catalog = unitTypeId.GetTypeCatalogStringForUnit();

DownloadCompanyName downloads the name of the given parameter's owning account and records it in the given document.

var name = forgeId.DownloadCompanyName(document);
var name = forgeId.DownloadCompanyName(document, region);

DownloadParameterOptions retrieves settings associated with the given parameter from the Parameters Service.

var options = forgeId.DownloadParameterOptions();
var options = forgeId.DownloadParameterOptions(region);

DownloadParameter creates a shared parameter element in the given document according to a parameter definition downloaded from the Parameters Service.

var sharedParameter = forgeId.DownloadParameter(document, options);
var sharedParameter = forgeId.DownloadParameter(document, options, region);

Label

ToLabel converts enums and type identifiers to user-visible names.

var categoryLabel = BuiltInCategory.OST_Walls.ToLabel(); // "Walls"
var parameterLabel = BuiltInParameter.WALL_TOP_OFFSET.ToLabel(); // "Top Offset"
var parameterLabelRu = BuiltInParameter.WALL_TOP_OFFSET.ToLabel(LanguageType.Russian); // "Смещение сверху"
var groupLabel = BuiltInParameterGroup.PG_LENGTH.ToLabel(); // "Length"
var displayUnitLabel = DisplayUnitType.DUT_KILOWATTS.ToLabel(); // "Kilowatts"

var parameterTypeLabel = ParameterType.Length.ToLabel(); // "Length"
var disciplineLabel = DisciplineTypeId.Hvac.ToLabel(); // "HVAC"
var groupTypeLabel = GroupTypeId.Geometry.ToLabel(); // "Dimensions"
var parameterTypeIdLabel = ParameterTypeId.DoorCost.ToLabel(); // "Cost"
var specTypeLabel = SpecTypeId.SheetLength.ToLabel(); // "Sheet Length"
var symbolTypeLabel = SymbolTypeId.Hour.ToLabel(); // "h"
var unitTypeLabel = UnitTypeId.Hertz.ToLabel(); // "Hertz"

var failureLabel = FailureSeverity.DocumentCorruption.ToLabel(); // "Document Corruption"
var sectionShapeLabel = StructuralSectionShape.RectangleParameterized.ToLabel() // "Rectangle Parameterized"

ToDisciplineLabel converts ForgeTypeId to user-visible name for a discipline.

var label = DisciplineTypeId.Hvac.ToDisciplineLabel(); // "HVAC"

ToGroupLabel converts ForgeTypeId to user-visible name for a built-in parameter group.

var label = GroupTypeId.Geometry.ToGroupLabel(); // "Dimensions"

ToParameterLabel converts ForgeTypeId to user-visible name for a built-in parameter.

var label = ParameterTypeId.DoorCost.ToParameterLabel(); // "Cost"

ToSpecLabel converts ForgeTypeId to user-visible name for a spec.

var label = SpecTypeId.SheetLength.ToSpecLabel(); // "Sheet Length"

ToSymbolLabel converts ForgeTypeId to user-visible name for a symbol.

var label = SymbolTypeId.Hour.ToSymbolLabel(); // "h"

ToUnitLabel converts ForgeTypeId to user-visible name for a unit.

var label = UnitTypeId.Hertz.ToUnitLabel(); // "Hertz"

Color

ToHex returns a hexadecimal representation of a color.

var hex = color.ToHex();

ToHexInteger returns a hexadecimal integer representation of a color.

var hexInteger = color.ToHexInteger();

ToRgb returns an RGB representation of a color.

var rgb = color.ToRgb();

ToHsl returns a HSL representation of a color.

var hsl = color.ToHsl();

ToHsv returns a HSV representation of a color.

var hsv = color.ToHsv();

ToCmyk returns a CMYK representation of a color.

var cmyk = color.ToCmyk();

ToHsb returns a HSB representation of a color.

var hsb = color.ToHsb();

ToHsi returns a HSI representation of a color.

var hsi = color.ToHsi();

ToHwb returns a HWB representation of a color.

var hwb = color.ToHwb();

ToNCol returns a NCol representation of a color.

var ncol = color.ToNCol();

ToCielab returns a CIE LAB representation of a color.

var cielab = color.ToCielab();

ToCieXyz returns a CIE XYZ representation of a color.

var xyz = color.ToCieXyz();

ToFloat returns a float representation of a color.

var floatColor = color.ToFloat();

ToDecimal returns a decimal representation of a color.

var decimalColor = color.ToDecimal();

FilteredElementCollector

CollectElements creates a new FilteredElementCollector for the document.

var collector = document.CollectElements();
var collector = document.CollectElements(viewId);
var collector = document.CollectElements(view);
var collector = document.CollectElements(elementIds);

OfClass applies an ElementClassFilter to the collector with generic type support.

var walls = document.CollectElements()
    .OfClass<Wall>()
    .ToElements();

OfClasses applies an ElementMulticlassFilter to the collector to match elements whose class matches any of the given types.

var elements = document.CollectElements()
    .OfClasses(typeof(Wall), typeof(Floor))
    .ToElements();

ExcludingClass applies an inverted ElementClassFilter to match all elements that are not of the given type.

var elements = document.CollectElements()
    .ExcludingClass<Wall>()
    .ToElements();

ExcludingClasses applies an inverted ElementMulticlassFilter to match all elements whose class does not match any of the given types.

var elements = document.CollectElements()
    .ExcludingClasses(typeof(Wall), typeof(Grid))
    .ToElements();

OfCategories applies an ElementMulticategoryFilter to the collector to match elements belonging to any of the given categories.

var elements = document.CollectElements()
    .OfCategories(BuiltInCategory.OST_Walls, BuiltInCategory.OST_Floors)
    .ToElements();

ExcludingCategory applies an inverted ElementCategoryFilter to match all elements not belonging to the given category.

var elements = document.CollectElements()
    .ExcludingCategory(BuiltInCategory.OST_Walls)
    .ToElements();

ExcludingCategories applies an inverted ElementMulticategoryFilter to match all elements not belonging to any of the given categories.

var elements = document.CollectElements()
    .ExcludingCategories(BuiltInCategory.OST_Walls, BuiltInCategory.OST_Grids)
    .ToElements();

OfElements applies an ElementIdSetFilter to match only elements with the given ids.

var elements = document.CollectElements()
    .OfElements(ids)
    .ToElements();

OfCurveElementType applies a CurveElementFilter to match curve elements of the given type.

var modelCurves = document.CollectElements()
    .OfCurveElementType(CurveElementType.ModelCurve)
    .ToElements();

ExcludingCurveElementType applies an inverted CurveElementFilter to match all curve elements not of the given type.

var elements = document.CollectElements()
    .ExcludingCurveElementType(CurveElementType.DetailCurve)
    .ToElements();

OfStructuralType applies an ElementStructuralTypeFilter to match elements of the given structural type.

var nonStructural = document.CollectElements()
    .OfStructuralType(StructuralType.NonStructural)
    .ToElements();

ExcludingStructuralType applies an inverted ElementStructuralTypeFilter to match all elements not of the given structural type.

var elements = document.CollectElements()
    .ExcludingStructuralType(StructuralType.NonStructural)
    .ToElements();

Types applies an ElementIsElementTypeFilter. Only element types will pass the collector.

var types = document.CollectElements()
    .Types()
    .ToElements();

Instances applies an inverted ElementIsElementTypeFilter. Only element instances will pass the collector.

var instances = document.CollectElements()
    .Instances()
    .ToElements();

Rooms applies a RoomFilter to match room elements.

var rooms = document.CollectElements()
    .Rooms()
    .ToElements();

RoomTags applies a RoomTagFilter to match room tag elements.

var roomTags = document.CollectElements()
    .RoomTags()
    .ToElements();

Areas applies an AreaFilter to match area elements.

var areas = document.CollectElements()
    .Areas()
    .ToElements();

AreaTags applies an AreaTagFilter to match area tag elements.

var areaTags = document.CollectElements()
    .AreaTags()
    .ToElements();

Spaces applies a SpaceFilter to match space elements.

var spaces = document.CollectElements()
    .Spaces()
    .ToElements();

SpaceTags applies a SpaceTagFilter to match space tag elements.

var spaceTags = document.CollectElements()
    .SpaceTags()
    .ToElements();

FamilySymbols applies a FamilySymbolFilter to match all family symbols belonging to the given family.

var symbols = document.CollectElements()
    .FamilySymbols(family)
    .ToElements();

FamilyInstances applies a FamilyInstanceFilter to match family instances of the given family symbol.

var instances = document.CollectElements()
    .FamilyInstances(symbol)
    .ToElements();

IsCurveDriven applies an ElementIsCurveDrivenFilter to match elements that are curve-driven.

var curveDriven = document.CollectElements()
    .IsCurveDriven()
    .ToElements();

IsViewIndependent applies an ElementIsCurveDrivenFilter to match elements that are view-independent.

var viewIndependent = document.CollectElements()
    .IsViewIndependent()
    .ToElements();

IsPrimaryDesignOptionMember applies a PrimaryDesignOptionMemberFilter to match elements contained in any primary design option of any design option set.

var primary = document.CollectElements()
    .IsPrimaryDesignOptionMember()
    .ToElements();

IsNotPrimaryDesignOptionMember applies an inverted PrimaryDesignOptionMemberFilter to match all elements not contained in any primary design option.

var nonPrimary = document.CollectElements()
    .IsNotPrimaryDesignOptionMember()
    .ToElements();

OwnedByView applies an ElementOwnerViewFilter to match elements owned by the given view.

var viewElements = document.CollectElements(viewId)
    .OwnedByView(view)
    .ToElements();

NotOwnedByView applies an inverted ElementOwnerViewFilter to match all elements not owned by the given view.

var nonViewElements = document.CollectElements()
    .NotOwnedByView(view)
    .ToElements();

VisibleInView applies a VisibleInViewFilter to match elements visible in the given view.

var visible = document.CollectElements(view.Id)
    .VisibleInView(view)
    .ToElements();

NotVisibleInView applies an inverted VisibleInViewFilter to match all elements not visible in the given view.

var notVisible = document.CollectElements(view.Id)
    .NotVisibleInView(view)
    .ToElements();

SelectableInView applies a SelectableInViewFilter to match elements that are selectable in the given view.

var selectable = document.CollectElements(viewId)
    .SelectableInView(view)
    .ToElements();

NotSelectableInView applies an inverted SelectableInViewFilter to match all elements that are not selectable in the given view.

var notSelectable = document.CollectElements(viewId)
    .NotSelectableInView(view)
    .ToElements();

OnLevel applies an ElementLevelFilter to match elements associated with the given level.

var onGround = document.CollectElements()
    .OnLevel(level)
    .ToElements();

NotOnLevel applies an inverted ElementLevelFilter to match all elements not associated with the given level.

var notOnGround = document.CollectElements()
    .NotOnLevel(level)
    .ToElements();

InDesignOption applies an ElementDesignOptionFilter to match elements contained within the given design option.

var elements = document.CollectElements()
    .InDesignOption(designOption)
    .ToElements();

NotInDesignOption applies an inverted ElementDesignOptionFilter to match all elements not contained within the given design option.

var elements = document.CollectElements()
    .NotInDesignOption(designOption)
    .ToElements();

InWorkset applies an ElementWorksetFilter to match elements in the given workset.

var elements = document.CollectElements()
    .InWorkset(worksetId)
    .ToElements();

NotInWorkset applies an inverted ElementWorksetFilter to match all elements not in the given workset.

var elements = document.CollectElements()
    .NotInWorkset(worksetId)
    .ToElements();

WithStructuralUsage applies a StructuralInstanceUsageFilter to match structural family instances with the given structural usage.

var columns = document.CollectElements()
    .WithStructuralUsage(StructuralInstanceUsage.Column)
    .ToElements();

WithoutStructuralUsage applies an inverted StructuralInstanceUsageFilter to match all family instances not of the given structural usage.

var nonColumns = document.CollectElements()
    .WithoutStructuralUsage(StructuralInstanceUsage.Column)
    .ToElements();

WithStructuralWallUsage applies a StructuralWallUsageFilter to match walls with the given structural wall usage.

var bearingWalls = document.CollectElements()
    .WithStructuralWallUsage(StructuralWallUsage.Bearing)
    .ToElements();

WithoutStructuralWallUsage applies an inverted StructuralWallUsageFilter to match all walls not of the given structural wall usage.

var nonBearing = document.CollectElements()
    .WithoutStructuralWallUsage(StructuralWallUsage.Bearing)
    .ToElements();

WithStructuralMaterial applies a StructuralMaterialTypeFilter to match family instances that have the given structural material type.

var steelElements = document.CollectElements()
    .WithStructuralMaterial(StructuralMaterialType.Steel)
    .ToElements();

WithoutStructuralMaterial applies an inverted StructuralMaterialTypeFilter to match all family instances not of the given structural material type.

var nonSteel = document.CollectElements()
    .WithoutStructuralMaterial(StructuralMaterialType.Steel)
    .ToElements();

WithFamilyStructuralMaterial applies a FamilyStructuralMaterialTypeFilter to match families that have the given structural material type.

var concreteFamilies = document.CollectElements()
    .WithFamilyStructuralMaterial(StructuralMaterialType.Concrete)
    .ToElements();

WithoutFamilyStructuralMaterial applies an inverted FamilyStructuralMaterialTypeFilter to match all families not of the given structural material type.

var nonConcrete = document.CollectElements()
    .WithoutFamilyStructuralMaterial(StructuralMaterialType.Concrete)
    .ToElements();

WithPhaseStatus applies an ElementPhaseStatusFilter to match elements that have any of the given phase statuses on the given phase.

var newElements = document.CollectElements()
    .WithPhaseStatus(phase, ElementOnPhaseStatus.New)
    .ToElements();

WithoutPhaseStatus applies an inverted ElementPhaseStatusFilter to match all elements that do not have any of the given phase statuses on the given phase.

var notNew = document.CollectElements()
    .WithoutPhaseStatus(phase, ElementOnPhaseStatus.New)
    .ToElements();

WithExtensibleStorage applies an ExtensibleStorageFilter to match elements that have extensible storage data for the given schema.

var elements = document.CollectElements()
    .WithExtensibleStorage(schemaGuid)
    .ToElements();

HasSharedParameter applies a SharedParameterApplicableRule filter to match elements that support a shared parameter with the given name.

var elements = document.CollectElements()
    .HasSharedParameter("SharedParameter")
    .ToElements();

IntersectingBoundingBox applies a BoundingBoxIntersectsFilter to match elements whose bounding box intersects the given outline.

var elements = document.CollectElements()
    .IntersectingBoundingBox(outline)
    .ToElements();

NotIntersectingBoundingBox applies an inverted BoundingBoxIntersectsFilter to match all elements whose bounding box does not intersect the given outline.

var elements = document.CollectElements()
    .NotIntersectingBoundingBox(outline)
    .ToElements();

InsideBoundingBox applies a BoundingBoxIsInsideFilter to match elements whose bounding box is fully contained by the given outline.

var elements = document.CollectElements()
    .InsideBoundingBox(outline)
    .ToElements();

NotInsideBoundingBox applies an inverted BoundingBoxIsInsideFilter to match all elements whose bounding box is not fully contained by the given outline.

var elements = document.CollectElements()
    .NotInsideBoundingBox(outline)
    .ToElements();

ContainingPoint applies a BoundingBoxContainsPointFilter to match elements whose bounding box contains the given point.

var elements = document.CollectElements()
    .ContainingPoint(point)
    .ToElements();

NotContainingPoint applies an inverted BoundingBoxContainsPointFilter to match all elements whose bounding box does not contain the given point.

var elements = document.CollectElements()
    .NotContainingPoint(point)
    .ToElements();

IntersectingElement applies an ElementIntersectsElementFilter to match elements whose geometry intersects the given element.

var intersecting = document.CollectElements()
    .IntersectingElement(wall)
    .ToElements();

NotIntersectingElement applies an inverted ElementIntersectsElementFilter to match all elements whose geometry does not intersect the given element.

var notIntersecting = document.CollectElements()
    .NotIntersectingElement(wall)
    .ToElements();

IntersectingSolid applies an ElementIntersectsSolidFilter to match elements whose geometry intersects the given solid.

var intersecting = document.CollectElements()
    .IntersectingSolid(solid)
    .ToElements();

NotIntersectingSolid applies an inverted ElementIntersectsSolidFilter to match all elements whose geometry does not intersect the given solid.

var notIntersecting = document.CollectElements()
    .NotIntersectingSolid(solid)
    .ToElements();

WhereParameter begins a fluent parameter filter expression for the given built-in parameter or parameter id. It applies ElementParameterFilter with ParameterFilterRuleFactory rules — Revit's native filtering engine that evaluates parameters at the database level before element expansion, unlike LINQ post-filtering which requires loading every element into memory first.

var wallsOnLevel = document.CollectElements()
    .WhereParameter(BuiltInParameter.WALL_BASE_CONSTRAINT).Equals(levelId)
    .ToElements();

var tallWalls = document.CollectElements()
    .WhereParameter(BuiltInParameter.WALL_USER_HEIGHT_PARAM).IsGreaterThan(3.0, 1e-6)
    .ToElements();

var genericTypes = document.CollectElements()
    .WhereParameter(BuiltInParameter.ALL_MODEL_TYPE_NAME).Contains("Generic")
    .ToElements();

// Supports all Rulus provided by Revit API:
//.Equals(string | int | double | ElementId)
//.NotEquals(string | int | double | ElementId)
//.IsGreaterThan(string | int | double | ElementId)
//.IsGreaterThanOrEqualTo(string | int | double | ElementId)
//.IsLessThan(string | int | double | ElementId)
//.IsLessThanOrEqualTo(string | int | double | ElementId)
//.Contains(string)
//.NotContains(string)
//.StartsWith(string)
//.NotStartsWith(string)
//.EndsWith(string)
//.NotEndsWith(string)
//.HasValue()
//.HasNoValue()
//.IsAssociatedWithGlobalParameter(ElementId)
//.IsNotAssociatedWithGlobalParameter(ElementId)

First and FirstOrDefault return the first element in the collector. These use Revit native fast implementation instead of LINQ.

var first = document.CollectElements()
    .Types()
    .First();

var firstOrNull = document.CollectElements()
    .Types()
    .FirstOrDefault();

Count returns the number of elements in the collector using Revit's native GetElementCount(). This use Revit native fast implementation instead of LINQ

var count = document.CollectElements()
    .OfClass<Wall>()
    .Count();

Any returns true if the collector contains at least one element. These use Revit native fast implementation instead of LINQ.

var hasWalls = document.CollectElements()
    .OfClass<Wall>()
    .Any();

Families and modeling

Family

CanBeConvertedToFaceHostBased indicates whether the family can be converted to face host based.

var canConvert = family.CanBeConvertedToFaceHostBased;
var canConvert = elementId.CanBeConvertedToFaceHostBased(document);

ConvertToFaceHostBased converts a family to be face host based.

family.ConvertToFaceHostBased();
elementId.ConvertToFaceHostBased(document);

CheckIntegrity checks that the loaded family has its content document.

var isValid = family.CheckIntegrity();
var isValid = elementId.CheckFamilyIntegrity(document);

FamilySymbol

IsAdaptiveFamilySymbol verifies if a FamilySymbol is a valid Adaptive Family Symbol.

var isAdaptive = familySymbol.IsAdaptiveFamilySymbol;

GetProfileSymbols gets the profile Family Symbols of the document.

var symbols = FamilySymbol.GetProfileSymbols(document, ProfileFamilyUsage.Any, oneCurveLoopOnly: true);

FamilyInstance

IsVoidInstanceCuttingElement indicates if the family instance with unattached voids can cut other elements.

var isCutting = familyInstance.IsVoidInstanceCuttingElement;

GetElementsBeingCut returns ids of the elements being cut by the instance.

var ids = familyInstance.GetElementsBeingCut();

Form

CanBeDissolved validates that input contains one or more form elements that can be dissolved.

var canDissolve = Form.CanBeDissolved(document, elements);

DissolveForms dissolves a collection of form elements into their defining elements.

var curveIds = Form.DissolveForms(document, elements);
var curveIds = Form.DissolveForms(document, elements, out var profileOriginPointSet);

HostObject

GetBottomFaces returns the bottom faces for the host object.

var faces = floor.GetBottomFaces();

GetTopFaces returns the top faces for the host object.

var faces = floor.GetTopFaces();

GetSideFaces returns the major side faces for the host object.

var faces = wall.GetSideFaces(ShellLayerType.Interior);

Wall

IsJoinAllowedAtEnd identifies if the indicated end of the wall allows joins.

var allowed = wall.IsJoinAllowedAtEnd(end: 0);

AllowJoinAtEnd allows the wall's end to join to other walls.

wall.AllowJoinAtEnd(end: 0);

DisallowJoinAtEnd sets the wall's end not to join to other walls.

wall.DisallowJoinAtEnd(end: 0);

Adaptive components

IsAdaptiveComponentFamily verifies if the Family is an Adaptive Component Family.

var isAdaptive = family.IsAdaptiveComponentFamily;

IsAdaptiveInstanceFlipped gets the value of the flip parameter on the adaptive instance.

var isFlipped = familyInstance.IsAdaptiveInstanceFlipped;

SetAdaptiveInstanceFlipped sets the value of the flip parameter on the adaptive instance.

familyInstance.SetAdaptiveInstanceFlipped(flip: true);

MoveAdaptiveComponentInstance moves an Adaptive Component Instance by the specified transformation.

familyInstance.MoveAdaptiveComponentInstance(transform, unHost: false);

GetNumberOfAdaptivePoints gets the number of Adaptive Point Elements in an Adaptive Component Family.

var count = family.GetNumberOfAdaptivePoints();

GetNumberOfAdaptivePlacementPoints gets the number of Placement Point Elements in an Adaptive Component Family.

var count = family.GetNumberOfAdaptivePlacementPoints();

GetNumberOfAdaptiveShapeHandlePoints gets the number of Shape Handle Point Elements in an Adaptive Component Family.

var count = family.GetNumberOfAdaptiveShapeHandlePoints();

IsAdaptivePlacementPoint verifies if the Reference Point is an Adaptive Placement Point.

var isPlacementPoint = referencePoint.IsAdaptivePlacementPoint;

IsAdaptivePoint verifies if the Reference Point is an Adaptive Point.

var isAdaptivePoint = referencePoint.IsAdaptivePoint;

IsAdaptiveShapeHandlePoint verifies if the Reference Point is an Adaptive Shape Handle Point.

var isShapeHandle = referencePoint.IsAdaptiveShapeHandlePoint;

MakeAdaptivePoint makes a Reference Point an Adaptive Point or makes an Adaptive Point a Reference Point.

referencePoint.MakeAdaptivePoint(AdaptivePointType.Placement);

GetAdaptivePlacementNumber gets the placement number of an Adaptive Placement Point.

var number = referencePoint.GetAdaptivePlacementNumber();

GetAdaptivePointConstraintType gets the constraint type of an Adaptive Shape Handle Point.

var type = referencePoint.GetAdaptivePointConstraintType();

GetAdaptivePointOrientationType gets the orientation type of an Adaptive Placement Point.

var type = referencePoint.GetAdaptivePointOrientationType();

SetAdaptivePlacementNumber sets the placement number of an Adaptive Placement Point.

referencePoint.SetAdaptivePlacementNumber(placementNumber);

SetAdaptivePointConstraintType sets the constraint type of an Adaptive Shape Handle Point.

referencePoint.SetAdaptivePointConstraintType(constraintType);

SetAdaptivePointOrientationType sets the orientation type of an Adaptive Placement Point.

referencePoint.SetAdaptivePointOrientationType(orientationType);

HasAdaptiveFamilySymbol verifies if a FamilyInstance has an Adaptive Family Symbol.

var hasAdaptive = familyInstance.HasAdaptiveFamilySymbol;

IsAdaptiveComponentInstance verifies if a FamilyInstance is an Adaptive Component Instance.

var isAdaptive = familyInstance.IsAdaptiveComponentInstance;

GetAdaptivePlacementPointElementRefIds gets the Placement Adaptive Point Element Ref ids to which the instance geometry adapts.

var ids = familyInstance.GetAdaptivePlacementPointElementRefIds();

GetAdaptivePointElementRefIds gets all Adaptive Point Element Ref ids to which the instance geometry adapts.

var ids = familyInstance.GetAdaptivePointElementRefIds();

GetAdaptiveShapeHandlePointElementRefIds gets Shape Handle Adaptive Point Element Ref ids.

var ids = familyInstance.GetAdaptiveShapeHandlePointElementRefIds();

CreateAdaptiveComponentInstance creates a FamilyInstance of an Adaptive Component Family.

var instance = familySymbol.CreateAdaptiveComponentInstance();

Annotation

IsMultiAlignSupported returns true if the element can be aligned to other similar elements.

var supports = element.IsMultiAlignSupported;

GetAnnotationOutlineWithoutLeaders gets the four corners of the alignable element in model space without its leaders.

var corners = element.GetAnnotationOutlineWithoutLeaders();

MoveWithAnchoredLeaders moves the element while keeping the leader end points anchored.

element.MoveWithAnchoredLeaders(moveVector);

Detail

IsDetailElement indicates if the element participates in detail draw ordering in the view.

var isDetail = element.IsDetailElement(view);
var isDetail = elementId.IsDetailElement(document, view);
var areDetails = elementIds.AreDetailElements(document, view);

BringForward moves the given detail instance one step closer to the front.

element.BringForward(view);
elementId.BringForward(document, view);
elementIds.BringForward(document, view);

BringToFront places the given detail instance in front of all other detail instances.

element.BringToFront(view);
elementId.BringToFront(document, view);
elementIds.BringToFront(document, view);

SendBackward moves the given detail instance one step closer to the back.

element.SendBackward(view);
elementId.SendBackward(document, view);
elementIds.SendBackward(document, view);

SendToBack places the given detail instance behind all other detail instances.

element.SendToBack(view);
elementId.SendToBack(document, view);
elementIds.SendToBack(document, view);

GetDrawOrderForDetails returns the given detail elements sorted according to the current draw order.

var sorted = view.GetDrawOrderForDetails(detailIds);

Parts

HasAssociatedParts checks if an element has associated parts.

var hasParts = element.HasAssociatedParts;
var hasParts = elementId.HasAssociatedParts(document);
var hasParts = linkElementId.HasAssociatedParts(document);

GetAssociatedParts returns all Parts that are associated with the given element.

var parts = element.GetAssociatedParts(includePartsWithAssociatedParts: true, includeAllChildren: true);
var parts = elementId.GetAssociatedParts(document, includePartsWithAssociatedParts: true, includeAllChildren: true);

GetAssociatedPartMaker gets associated PartMaker for an element.

var maker = element.GetAssociatedPartMaker();
var maker = elementId.GetAssociatedPartMaker(document);

CreateParts creates a new set of parts out of the original elements.

elementIds.CreateParts(document);
hostOrLinkElements.CreateParts(document);

DivideParts creates divided parts out of parts.

var maker = elementIds.DivideParts(document, intersectingReferenceIds, curveArray, sketchPlaneId);

CreateMergedPart creates a single merged part from the specified Parts.

var maker = elementIds.CreateMergedPart(document);

IsMergedPart checks if the Part is the result of a merge.

var isMerged = part.IsMergedPart;

GetSplittingCurves identifies the curves that were used to create the part.

var curves = part.GetSplittingCurves();
var curves = elementId.GetSplittingCurves(document);

GetSplittingElements identifies the elements that were used to create the part.

var elements = part.GetSplittingElements();
var elements = elementId.GetSplittingElements(document);

AreElementsValidForCreateParts identifies if the given elements can be used to create parts.

var valid = elementIds.AreElementsValidForCreateParts(document);

IsValidForCreateParts identifies if the given element can be used to create parts.

var valid = linkElementId.IsValidForCreateParts(document);

ArePartsValidForDivide identifies if the provided members are valid for dividing parts.

var valid = elementIds.ArePartsValidForDivide(document);

ArePartsValidForMerge identifies whether Part elements may be merged.

var valid = elementIds.ArePartsValidForMerge(document);

FindMergeableClusters segregates a set of elements into subsets which are valid for merge.

var clusters = elementIds.FindMergeableClusters(document);

GetChainLengthToOriginal calculates the length of the longest chain of divisions/merges to reach the original non-Part element.

var length = part.GetChainLengthToOriginal();

GetMergedParts retrieves the element ids of the source elements of a merged part.

var ids = part.GetMergedParts();

GetPartMakerMethodToDivideVolumeFw obtains the object allowing access to the divided volume properties of the PartMaker.

var method = partMaker.GetPartMakerMethodToDivideVolumeFw();

Assembly

AcquireViews transfers the assembly views owned by a source assembly instance to a target sibling assembly instance.

sourceAssembly.AcquireViews(targetAssembly);

Create3DOrthographic creates a new orthographic 3D assembly view for the assembly instance.

var view = assemblyInstance.Create3DOrthographic();
var view = assemblyInstance.Create3DOrthographic(viewTemplateId, isAssigned: true);

CreateDetailSection creates a new detail section assembly view for the assembly instance.

var view = assemblyInstance.CreateDetailSection(AssemblyDetailViewOrientation.ElevationBottom);
var view = assemblyInstance.CreateDetailSection(AssemblyDetailViewOrientation.ElevationBottom, viewTemplateId, isAssigned: true);

CreateMaterialTakeoff creates a new material takeoff multicategory schedule assembly view for the assembly instance.

var schedule = assemblyInstance.CreateMaterialTakeoff();
var schedule = assemblyInstance.CreateMaterialTakeoff(viewTemplateId, isAssigned: true);

CreatePartList creates a new part list multicategory schedule assembly view for the assembly instance.

var schedule = assemblyInstance.CreatePartList();
var schedule = assemblyInstance.CreatePartList(viewTemplateId, isAssigned: true);

CreateSheet creates a new sheet assembly view for the assembly instance.

var sheet = assemblyInstance.CreateSheet(titleBlockId);

CreateSingleCategorySchedule creates a new single-category schedule assembly view for the assembly instance.

var schedule = assemblyInstance.CreateSingleCategorySchedule(scheduleCategoryId);
var schedule = assemblyInstance.CreateSingleCategorySchedule(scheduleCategoryId, viewTemplateId, isAssigned: true);

Mass

IsMassFamilyInstance checks if the element is a mass family instance.

var isMass = massInstance.IsMassFamilyInstance;
var isMass = massInstanceId.IsMassFamilyInstance(document);

GetMassGrossFloorArea gets the total occupiable floor area represented by a mass instance.

var area = massInstance.GetMassGrossFloorArea();
var area = massInstanceId.GetMassGrossFloorArea(document);

GetMassGrossSurfaceArea gets the total exterior building surface area represented by a mass instance.

var area = massInstance.GetMassGrossSurfaceArea();
var area = massInstanceId.GetMassGrossSurfaceArea(document);

GetMassGrossVolume gets the total building volume represented by a mass instance.

var volume = massInstance.GetMassGrossVolume();
var volume = massInstanceId.GetMassGrossVolume(document);

GetMassLevelDataIds gets the ElementIds of the MassLevelDatas associated with a mass instance.

var ids = massInstance.GetMassLevelDataIds();
var ids = massInstanceId.GetMassLevelDataIds(document);

GetMassJoinedElementIds gets the ElementIds of elements that are joined to a mass instance.

var ids = massInstance.GetMassJoinedElementIds();
var ids = massInstanceId.GetMassJoinedElementIds(document);

GetMassLevelIds gets the ElementIds of the Levels associated with a mass instance.

var ids = massInstance.GetMassLevelIds();
var ids = massInstanceId.GetMassLevelIds(document);

AddMassLevelData creates a MassLevelData to associate a Level with a mass instance.

var id = massInstance.AddMassLevelData(levelId);
var id = massInstanceId.AddMassLevelData(document, levelId);

RemoveMassLevelData deletes the MassLevelData that associates a Level with a mass instance.

massInstance.RemoveMassLevelData(levelId);
massInstanceId.RemoveMassLevelData(document, levelId);

Disciplines

MEP

Pipe

ConnectPipePlaceholdersAtElbow connects placeholders that look like an elbow connection.

var isConnected = connector1.ConnectPipePlaceholdersAtElbow(connector2);

ConnectPipePlaceholdersAtTee connects three placeholders that look like a Tee connection.

var isConnected = connector1.ConnectPipePlaceholdersAtTee(connector2, connector3);

ConnectPipePlaceholdersAtCross connects placeholders that look like a Cross connection.

var isConnected = connector1.ConnectPipePlaceholdersAtCross(connector2, connector3, connector4);

ConvertPipePlaceholders converts a collection of pipe placeholder elements into pipe elements.

var ids = placeholderIds.ConvertPipePlaceholders(document);

PlaceCapOnOpenEnds places caps on the open connectors of the pipe curve.

pipe.PlaceCapOnOpenEnds();
pipe.PlaceCapOnOpenEnds(typeId);

HasOpenConnector checks if there is an open piping connector for the given pipe curve.

var hasOpen = pipe.HasOpenConnector;

BreakCurve breaks the pipe curve into two parts at the given position.

var newPipeId = pipe.BreakCurve(new XYZ(1, 1, 1));
Duct

BreakCurve breaks the duct curve into two parts at the given position.

var newDuctId = duct.BreakCurve(new XYZ(1, 1, 1));

ConnectAirTerminal connects an air terminal to a duct directly.

var isConnected = duct.ConnectAirTerminal(airTerminalId);

ConvertDuctPlaceholders converts a collection of duct placeholder elements into duct elements.

var ids = placeholderIds.ConvertDuctPlaceholders(document);

NewDuctworkStiffener creates a family based stiffener on the specified fabrication ductwork.

var stiffener = document.NewDuctworkStiffener(familySymbol, host, distanceFromHostEnd);
Connector

ConnectDuctPlaceholdersAtElbow connects a pair of placeholders at an Elbow connection.

var isConnected = connector.ConnectDuctPlaceholdersAtElbow(other);

ConnectDuctPlaceholdersAtTee connects a trio of placeholders at a Tee connection.

var isConnected = connector.ConnectDuctPlaceholdersAtTee(connector2, connector3);

ConnectDuctPlaceholdersAtCross connects a group of placeholders at a Cross connection.

var isConnected = connector.ConnectDuctPlaceholdersAtCross(connector2, connector3, connector4);

ValidateFabricationConnectivity checks if two connectors are valid to connect directly without couplings.

var isValid = connector.ValidateFabricationConnectivity(other);
Fabrication

ExportToPcf exports a list of fabrication parts into PCF format.

document.ExportToPcf(filename, ids);

Structure

Rebar

CanBeSpliced verifies if the rebar can be spliced with the provided line or geometry.

var error = rebar.CanBeSpliced(spliceOptions, line, linePlaneNormal);
var error = rebar.CanBeSpliced(spliceOptions, line, viewId);
var error = rebar.CanBeSpliced(spliceOptions, spliceGeometry);

Splice splices a rebar with a line or a list of RebarSpliceGeometry.

var ids = rebar.Splice(spliceOptions, line, linePlaneNormal);
var ids = rebar.Splice(spliceOptions, line, viewId);
var ids = rebar.Splice(spliceOptions, spliceGeometries);

var ids = elementId.SpliceRebar(document, spliceOptions, line, linePlaneNormal);
var ids = elementId.SpliceRebar(document, spliceOptions, line, viewId);
var ids = elementId.SpliceRebar(document, spliceOptions, spliceGeometries);

UnifyRebarsIntoOne unifies two rebars by removing the splice between them.

var newId = rebar.UnifyRebarsIntoOne(secondRebarId);
var newId = elementId.UnifyRebarsIntoOne(document, secondRebarId);

GetSpliceChain returns all the rebars that are part of a splice chain with the input rebar.

var chain = rebar.GetSpliceChain();

GetLapDirectionForSpliceGeometryAndPosition computes the lap direction given a RebarSpliceGeometry and a RebarSplicePosition.

var direction = rebar.GetLapDirectionForSpliceGeometryAndPosition(spliceGeometry, splicePosition);

GetSpliceGeometries computes a list of RebarSpliceGeometry which respects the rules.

var result = rebar.GetSpliceGeometries(spliceOptions, spliceRules);
var result = elementId.GetRebarSpliceGeometries(document, spliceOptions, spliceRules);

AlignByFace copies source rebars aligned to the destination face.

var ids = sourceRebars.AlignByFace(document, sourceFaceReference, destinationFaceReference);

AlignByHost copies source rebars aligned in the same way as the source host is aligned to the destination host.

var ids = sourceRebars.AlignByHost(document, destinationHost);

GetAllParameters lists all shape parameters used by all existing RebarShapes in the document.

var ids = rebarShape.GetAllParameters();

IsValidRebarShapeParameter checks that an ExternalDefinition may be used as a Rebar Shape parameter.

var isValid = externalDefinition.IsValidRebarShapeParameter;

GetRebarShapeParameterElementId retrieves the ElementId corresponding to an external rebar shape parameter in the document.

var id = externalDefinition.GetRebarShapeParameterElementId(document);

GetOrCreateRebarShapeParameterElementId retrieves or creates the ElementId corresponding to an external rebar shape parameter in the document.

var id = externalDefinition.GetOrCreateRebarShapeParameterElementId(document);

NewRebarSpliceType creates a Rebar Splice Type element.

var spliceType = document.NewRebarSpliceType(typeName);

NewRebarCrankType creates a Rebar Crank Type element.

var crankType = document.NewRebarCrankType(typeName);

GetRebarSpliceLapLengthMultiplier gets the lap length multiplier value of the Rebar Splice Type.

var value = element.GetRebarSpliceLapLengthMultiplier();
var value = elementId.GetRebarSpliceLapLengthMultiplier(document);

GetRebarSpliceShiftOption identifies the way bars are shifted in the splice relation.

var option = element.GetRebarSpliceShiftOption();
var option = elementId.GetRebarSpliceShiftOption(document);

GetRebarSpliceStaggerLengthMultiplier gets the stagger length multiplier value of the Rebar Splice Type.

var value = element.GetRebarSpliceStaggerLengthMultiplier();
var value = elementId.GetRebarSpliceStaggerLengthMultiplier(document);

SetRebarSpliceLapLengthMultiplier sets the lap length multiplier value of the Rebar Splice Type.

element.SetRebarSpliceLapLengthMultiplier(lapLengthMultiplier);
elementId.SetRebarSpliceLapLengthMultiplier(document, lapLengthMultiplier);

SetRebarSpliceShiftOption sets the way bars are shifted in the splice relation.

element.SetRebarSpliceShiftOption(shiftOption);
elementId.SetRebarSpliceShiftOption(document, shiftOption);

SetRebarSpliceStaggerLengthMultiplier sets the stagger length multiplier value of the Rebar Splice Type.

element.SetRebarSpliceStaggerLengthMultiplier(staggerLengthMultiplier);
elementId.SetRebarSpliceStaggerLengthMultiplier(document, staggerLengthMultiplier);

GetRebarCrankLengthMultiplier gets the crank length multiplier value of the Rebar Crank Type.

var value = element.GetRebarCrankLengthMultiplier();
var value = elementId.GetRebarCrankLengthMultiplier(document);

GetRebarCrankOffsetMultiplier gets the crank offset multiplier value of the Rebar Crank Type.

var value = element.GetRebarCrankOffsetMultiplier();
var value = elementId.GetRebarCrankOffsetMultiplier(document);

GetRebarCrankRatio gets the crank ratio value of the Rebar Crank Type.

var value = element.GetRebarCrankRatio();
var value = elementId.GetRebarCrankRatio(document);

SetRebarCrankLengthMultiplier sets the crank length multiplier value of the Rebar Crank Type.

element.SetRebarCrankLengthMultiplier(crankLengthMultiplier);
elementId.SetRebarCrankLengthMultiplier(document, crankLengthMultiplier);

SetRebarCrankOffsetMultiplier sets the crank offset multiplier value of the Rebar Crank Type.

element.SetRebarCrankOffsetMultiplier(crankOffsetMultiplier);
elementId.SetRebarCrankOffsetMultiplier(document, crankOffsetMultiplier);

SetRebarCrankRatio sets the crank ratio value of the Rebar Crank Type.

element.SetRebarCrankRatio(crankRatio);
elementId.SetRebarCrankRatio(document, crankRatio);
Structural framing

CanFlipFramingEnds determines if the ends of the given framing element can be flipped.

var canFlip = familyInstance.CanFlipFramingEnds;

FlipFramingEnds flips the ends of the structural framing element.

familyInstance.FlipFramingEnds();

IsFramingJoinAllowedAtEnd identifies if the indicated end is allowed to join to others.

var allowed = familyInstance.IsFramingJoinAllowedAtEnd(end: 0);

AllowFramingJoinAtEnd sets the indicated end to be allowed to join.

familyInstance.AllowFramingJoinAtEnd(end: 0);

DisallowFramingJoinAtEnd sets the indicated end to not be allowed to join.

familyInstance.DisallowFramingJoinAtEnd(end: 0);

GetFramingEndReference returns a reference to the end of a framing element according to the setback settings.

var reference = familyInstance.GetFramingEndReference(end: 0);

IsFramingEndReferenceValid determines if the given reference can be set for the given end of the framing element.

var isValid = familyInstance.IsFramingEndReferenceValid(end: 0, pick);

CanSetFramingEndReference determines if a reference can be set for the given end of the framing element.

var canSet = familyInstance.CanSetFramingEndReference(end: 0);

SetFramingEndReference sets the end reference of a framing element.

familyInstance.SetFramingEndReference(end: 0, pick);

RemoveFramingEndReference resets the end reference of the structural framing element.

familyInstance.RemoveFramingEndReference(end: 0);
Structural sections

GetStructuralSection returns the structural section from an element.

var section = familyInstance.GetStructuralSection();
var section = elementId.GetStructuralSection(document);

SetStructuralSection sets the structural section in an element.

var success = familySymbol.SetStructuralSection(structuralSection);
var success = elementId.SetStructuralSection(document, structuralSection);

GetStructuralElementDefinitionData returns structural element definition data.

var code = familyInstance.GetStructuralElementDefinitionData(out var data);
var code = elementId.GetStructuralElementDefinitionData(document, out var data);

Analytical

IsAnalyticalElement returns true if the element is an analytical element.

var isAnalytical = element.IsAnalyticalElement;
var isAnalytical = elementId.IsAnalyticalElement(document);

IsPhysicalElement returns true if the element is a physical element.

var isPhysical = element.IsPhysicalElement;
var isPhysical = elementId.IsPhysicalElement(document);

Model access and interoperability

ModelPath

ConvertToUserVisiblePath gets a string version of the path of a given ModelPath.

var path = modelPath.ConvertToUserVisiblePath();

ConvertToCloudPath converts a pair of cloud project and model GUIDs to a valid cloud path.

var cloudPath = modelGuid.ConvertToCloudPath(projectGuid, region);

Worksharing

CreateNewLocal copies the central model into a new local file for the current user.

var localPath = centralPath.CreateNewLocal(targetPath);

GetUserWorksetInfo gets information about user worksets in a workshared model file without fully opening the file.

var info = modelPath.GetUserWorksetInfo();

GetCheckoutStatus gets the ownership status of an element and can also return the owner.

var status = element.GetCheckoutStatus();
var status = elementId.GetCheckoutStatus(document);

var statusWithOwner = element.GetCheckoutStatus(out var owner);
var statusWithOwner = elementId.GetCheckoutStatus(document, out var owner);

GetWorksharingTooltipInfo gets worksharing information about an element to display in an in-canvas tooltip.

var info = element.GetWorksharingTooltipInfo();
var info = elementId.GetWorksharingTooltipInfo(document);

GetModelUpdatesStatus gets the status of a single element in the central model.

var status = element.GetModelUpdatesStatus();
var status = elementId.GetModelUpdatesStatus(document);

RelinquishOwnership relinquishes ownership of as many specified elements and worksets as possible.

var items = document.RelinquishOwnership(relinquishOptions, transactOptions);

CheckoutWorksets obtains ownership for the current user of as many specified worksets as possible.

var checkedOut = worksets.CheckoutWorksets(document);
var checkedOut = worksets.CheckoutWorksets(document, options);

CheckoutElements obtains ownership for the current user of as many specified elements as possible.

var checkedOut = elementIds.CheckoutElements(document);
var checkedOut = elementIds.CheckoutElements(document, options);

Coordination model

IsCoordinationModelInstance checks whether an element is a Coordination Model instance.

var isInstance = element.IsCoordinationModelInstance;

IsCoordinationModelType checks whether an element is a Coordination Model type.

var isType = element.IsCoordinationModelType;

GetCoordinationModelVisibilityOverride gets the visibility override for the provided Coordination Model instance or type.

var isVisible = element.GetCoordinationModelVisibilityOverride(view);

SetCoordinationModelVisibilityOverride sets the visibility override for the provided Coordination Model instance or type.

element.SetCoordinationModelVisibilityOverride(view, visible: true);

LinkCoordinationModelFromLocalPath creates a Coordination Model instance using the absolute path of a .nwc or .nwd file.

var instance = document.LinkCoordinationModelFromLocalPath(filePath, linkOptions);

Link3DViewFromAutodeskDocs creates a Coordination Model instance based on the information provided by the specified Autodesk Docs data.

var instance = document.Link3DViewFromAutodeskDocs(accountId, projectId, fileId, viewName, linkOptions);

GetCoordinationModelTypeData gets link data for the provided Coordination Model type.

var data = elementType.GetCoordinationModelTypeData();

ReloadCoordinationModel reloads the provided Coordination Model type element.

elementType.ReloadCoordinationModel();

UnloadCoordinationModel unloads the provided Coordination Model type element.

elementType.UnloadCoordinationModel();

GetAllCoordinationModelInstanceIds gets all Coordination Model instance ids in the document.

var ids = document.GetAllCoordinationModelInstanceIds();

GetAllCoordinationModelTypeIds gets all Coordination Model type ids in the document.

var ids = document.GetAllCoordinationModelTypeIds();

GetAllPropertiesForReferenceInsideCoordinationModel gets all the properties for the provided Coordination Model instance reference.

var props = element.GetAllPropertiesForReferenceInsideCoordinationModel(reference);

GetCategoryForReferenceInsideCoordinationModel returns the category name for the provided element reference inside the Coordination Model instance.

var name = element.GetCategoryForReferenceInsideCoordinationModel(reference);

GetVisibilityOverrideForReferenceInsideCoordinationModel gets the visibility for the provided reference inside the Coordination Model.

var isVisible = element.GetVisibilityOverrideForReferenceInsideCoordinationModel(view, reference);

SetVisibilityOverrideForReferenceInsideCoordinationModel sets the visibility override for the provided reference inside the Coordination Model instance.

element.SetVisibilityOverrideForReferenceInsideCoordinationModel(view, reference, visible: true);

GetCoordinationModelColorOverride gets the color override value for the provided Coordination Model type.

var color = elementType.GetCoordinationModelColorOverride(view);

SetCoordinationModelColorOverride sets the color override value for the provided Coordination Model type.

elementType.SetCoordinationModelColorOverride(view, color);

GetCoordinationModelTransparencyOverride gets the transparency override value for the provided Coordination Model type.

var transparency = elementType.GetCoordinationModelTransparencyOverride(view);

SetCoordinationModelTransparencyOverride sets the transparency override value for the provided Coordination Model type.

elementType.SetCoordinationModelTransparencyOverride(view, transparency);

ContainsCoordinationModelCategory checks whether a provided string is an element category name in the provided Autodesk Docs Coordination Model type.

var contains = elementType.ContainsCoordinationModelCategory(categoryName);

GetCoordinationModelColorOverrideForCategory returns the color override value for the provided element category name inside the Coordination Model type.

var color = elementType.GetCoordinationModelColorOverrideForCategory(view, categoryName);

SetCoordinationModelColorOverrideForCategory sets the color override value for the provided element category name inside the Coordination Model type.

elementType.SetCoordinationModelColorOverrideForCategory(view, categoryName, color);

GetCoordinationModelVisibilityOverrideForCategory gets the visibility override for the provided element category name in the Coordination Model type.

var isVisible = elementType.GetCoordinationModelVisibilityOverrideForCategory(view, categoryName);

SetCoordinationModelVisibilityOverrideForCategory sets the visibility override for the provided element category name inside the Coordination Model type.

elementType.SetCoordinationModelVisibilityOverrideForCategory(view, categoryName, visible: true);

ReloadAutodeskDocsCoordinationModelFrom reloads an Autodesk Docs Coordination Model type from the specified Autodesk Docs data.

elementType.ReloadAutodeskDocsCoordinationModelFrom(accountId, projectId, fileId, viewName);

ReloadLocalCoordinationModelFrom reloads a local Coordination Model type from the specified absolute path.

elementType.ReloadLocalCoordinationModelFrom(filePath);

Export

GetExportId retrieves the GUID representing this element in DWF and IFC export.

var guid = element.ExportId;
var guid = subelement.ExportId;
var guid = elementId.GetExportId(document);

GbXmlId retrieves the GUID representing this document in exported gbXML files.

var guid = document.GbXmlId;

GetNurbsSurfaceData returns the necessary information to define a NURBS surface.

var data = surface.GetNurbsSurfaceData();

External files

IsExternalFileReference determines whether the given element represents an external file.

var isExternal = element.IsExternalFileReference;
var isExternal = elementId.IsExternalFileReference(document);

GetAllExternalFileReferences gets the ids of all elements which are external file references.

var ids = document.GetAllExternalFileReferences();

GetExternalFileReference gets the external file referencing data for the given element.

var reference = element.GetExternalFileReference();
var reference = elementId.GetExternalFileReference(document);

External resources

GetServers gets registered external resource servers which support the external resource type.

var servers = resourceType.GetServers();

ServerSupportsAssemblyCodeData and similar extensions check whether the server supports a given resource type.

var supports = externalResourceReference.ServerSupportsAssemblyCodeData;
var supports = externalResourceReference.ServerSupportsRevitLinks;
var supports = externalResourceReference.ServerSupportsCadLinks;
var supports = externalResourceReference.ServerSupportsIfcLinks;
var supports = externalResourceReference.ServerSupportsKeynotes;

IsValidShortName checks whether the name is a valid short name for the external resource server.

var isValid = ExternalResourceReference.IsValidShortName(serverId, serverName);

GetAllExternalResourceReferences gets the ids of all elements which refer to external resources.

var ids = document.GetAllExternalResourceReferences();
var ids = document.GetAllExternalResourceReferences(resourceType);

Point clouds

GetFilteredOutline computes the outline of a part of a box that satisfies the given PointCloudFilter.

var outline = filter.GetFilteredOutline(box);

DirectContext3D

IsADirectContext3DHandleCategory checks whether the category is one of the categories used by DirectContext3D handle elements.

var isHandle = category.IsADirectContext3DHandleCategory;

GetDirectContext3DHandleInstances returns all DirectContext3D handle instances of the given category in the document.

var ids = category.GetDirectContext3DHandleInstances(document);

GetDirectContext3DHandleTypes returns all DirectContext3D handle types of the given category in the document.

var ids = category.GetDirectContext3DHandleTypes(document);

IsADirectContext3DHandleInstance checks whether the element corresponds to a DirectContext3D handle instance.

var isInstance = element.IsADirectContext3DHandleInstance;

IsADirectContext3DHandleType checks whether the element corresponds to a DirectContext3D handle type.

var isType = element.IsADirectContext3DHandleType;

System

Cast<T> casts an object to the specified type.

var width = element.Cast<Wall>().Width;
var location = element.Location.Cast<LocationCurve>().Curve;

Round rounds the value to the specified precision or 1e-9 precision specified in Revit API.

var rounded = 6.56170000000000000000000001.Round(); // 6.5617
var rounded = 6.56170000000000000000000001.Round(0); // 7

IsAlmostEqual compares two numbers within specified precision or 1e-9 precision specified in Revit API.

var isEqual = 6.56170000000000000000000001.IsAlmostEqual(6.5617); // true
var isEqual = 6.56170000000000000000000001.IsAlmostEqual(6.6, 1e-1); // true

IsNullOrEmpty indicates whether the specified string is null or an empty string.

var isEmpty = "".IsNullOrEmpty(); // true
var isEmpty = null.IsNullOrEmpty(); // true

IsNullOrWhiteSpace indicates whether a specified string is null, empty, or consists only of white-space characters.

var isEmpty = " ".IsNullOrWhiteSpace(); // true
var isEmpty = null.IsNullOrWhiteSpace(); // true

AppendPath combines paths.

var path = "C:/Folder".AppendPath("AddIn"); // C:/Folder/AddIn

Show opens a window and sets the owner of a child window. Applicable for modeless windows to be attached to Revit.

new RevitAddinView().Show(uiApplication.MainWindowHandle);
Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0-windows7.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Nice3point.Revit.Extensions:

Package Downloads
HcBimUtils

Package Description

HC.Tech.So.Revit.Templates

Templates for Revit plugin development

DTDucas.RevitBase

Base framework for Revit API development with comprehensive command handling, exception suppression, and external event management

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Nice3point.Revit.Extensions:

Repository Stars
lookup-foundation/RevitLookup
Interactive Revit RFA and RVT project database exploration tool to view and navigate BIM element parameters, properties and relationships.
Nice3point/RevitTemplates
Templates for creating Revit add-ins
Version Downloads Last Updated
2027.0.0 180 4/7/2026
2027.0.0-preview.4.20260324 84 3/24/2026
2027.0.0-preview.3.20260319 57 3/19/2026
2026.1.0 401 4/7/2026
2026.1.0-preview.4.20260324 74 3/24/2026
2026.1.0-preview.3.20260319 45 3/19/2026
2025.2.0 418 4/7/2026
2025.2.0-preview.4.20260324 66 3/24/2026
2024.3.0 419 4/7/2026
2024.3.0-preview.4.20260324 77 3/24/2026
2023.5.0 407 4/7/2026
2023.5.0-preview.4.20260324 129 3/24/2026
2022.5.0 388 4/7/2026
2022.5.0-preview.4.20260324 60 3/24/2026
2021.5.0 245 4/7/2026
2021.5.0-preview.4.20260324 67 3/24/2026
2020.5.0 146 4/7/2026
2020.5.0-preview.4.20260324 45 3/24/2026
2019.5.0 79 4/7/2026
2019.5.0-preview.4.20260324 39 3/24/2026
Loading failed