Releases: Nice3point/RevitExtensions
2025.0.1-preview.2.1
This update focuses on increased utility class coverage, new extensions for global parameter management, for ForgeTypeId handling, advanced geometry extensions, and many-many more.
New Extensions
Element Association Extensions
- IsAnalyticalElement: Determines whether an element is an analytical element.
- IsPhysicalElement: Checks if an element is a physical one.
Element Worksharing Extensions
- GetCheckoutStatus: Retrieves the ownership status of an element, with an optional parameter to return the owner's name.
- GetWorksharingTooltipInfo: Provides worksharing information about an element for in-canvas tooltips.
- GetModelUpdatesStatus: Gets the status of an element in the central model.
ElementId Extensions
- ToElements: Retrieves a collection of Elements associated with the specified ElementIds.
- ToElements: Retrieves a collection of Elements associated with the specified ElementIds as the specified type T.
- ToOrderedElements: Retrieves the Elements associated with the specified ElementIds in their original order.
- ToOrderedElements: Retrieves the Elements associated with the specified ElementIds and casts them to the specified type T in their original order.
ElementId Transform Extensions
- CanMirrorElements: Verifies whether a set of elements can be mirrored.
- MirrorElements: Mirrors elements across a plane, with support for mirrored copies.
- MoveElements: Moves elements according to a specified transformation.
- RotateElements: Rotates elements around a given axis by a specified angle.
- CopyElements: Copies elements between views or within the same document, with options for translation and transformation.
Document Extensions
- GetProfileSymbols: Returns profile family symbols in the document.
- RelinquishOwnership: Allows relinquishment of ownership based on specified options.
Document Managers Extensions
- GetTemporaryGraphicsManager: Fetches a reference to the document’s temporary graphics manager.
- GetAnalyticalToPhysicalAssociationManager: Retrieves the manager for analytical-to-physical element associations.
- GetLightGroupManager: Creates or retrieves the light group manager for the document.
Geometry Extensions
- Contains: Determines if a point or another bounding box is contained within the bounding box, with strict mode available for more precise containment checks.
- Overlaps: Checks whether two bounding boxes overlap.
- ComputeCentroid: Calculates the geometric center of a bounding box.
- ComputeVertices: Returns the coordinates of the eight vertices of a bounding box.
- ComputeVolume: Computes the volume enclosed by the bounding box.
- ComputeSurfaceArea: Calculates the total surface area of the bounding box.
Parameters Extensions
- IsBuiltInParameter: Verifies if a parameter is a built-in parameter.
Document Global Parameters Extensions
- FindGlobalParameter: Locates a global parameter by name in the document.
- GetAllGlobalParameters: Returns all global parameters in the document.
- GetGlobalParametersOrdered: Retrieves ordered global parameters.
- SortGlobalParameters: Sorts global parameters in the specified order.
- MoveUpOrder: Moves a global parameter up in the order.
- MoveDownOrder: Moves a global parameter down in the order.
- IsUniqueGlobalParameterName: Checks if a global parameter name is unique.
- IsValidGlobalParameter: Validates if an ElementId is a global parameter.
- AreGlobalParametersAllowed: Checks if global parameters are permitted in the document.
ForgeTypeId Extensions
- IsSpec: Validates if a ForgeTypeId identifies a spec.
- IsBuiltInGroup: Determines whether a ForgeTypeId identifies a built-in parameter group.
- IsBuiltInParameter: Validates if a ForgeTypeId identifies a built-in parameter.
- IsSymbol: Checks if a ForgeTypeId identifies a symbol.
- IsUnit: Verifies if a ForgeTypeId identifies a unit.
- IsValidDataType: Determines if a ForgeTypeId identifies a valid parameter data type.
- IsValidUnit: Validates if a unit is valid for a measurable spec.
- IsMeasurableSpec: Checks if a ForgeTypeId represents a measurable spec.
- GetBuiltInParameter: Retrieves a BuiltInParameter from a ForgeTypeId.
- GetParameterTypeId: Fetches the ForgeTypeId corresponding to a BuiltInParameter.
- GetDiscipline: Gets the discipline for a measurable spec.
- GetValidUnits: Retrieves all valid units for a measurable spec.
- GetTypeCatalogStringForSpec: Fetches the type catalog string for a measurable spec.
- GetTypeCatalogStringForUnit: Retrieves the type catalog string for a unit.
- DownloadCompanyName: Downloads the owning company name for a parameter and records it in the document.
- DownloadParameterOptions: Fetches settings related to a parameter from the Parameters Service.
- DownloadParameter: Creates a shared parameter element in a document based on a downloaded parameter definition.
Color Extensions
- ToHex: Converts a color to its hexadecimal representation.
- ToHexInteger: Returns the hexadecimal integer representation of a color.
- ToRgb: Provides the RGB representation of a color.
- ToHsl: Converts a color to its HSL representation.
- ToHsv: Converts a color to its HSV representation.
- ToCmyk: Retrieves the CMYK representation of a color.
- ToHsb: Converts a color to HSB.
- ToHsi: Converts a color to HSI format.
- ToHwb: Provides the HWB representation of a color.
- ToNCol: Converts a color to NCol format.
- ToCielab: Retrieves the Cielab representation of a color.
- ToCieXyz: Converts a color to CieXyz format.
- ToFloat: Returns the float representation of a color.
- ToDecimal: Returns the decimal representation of a color.
Family Extensions
- CanConvertToFaceHostBased: Indicates whether a family can be converted to a face-hosted version.
- ConvertToFaceHostBased: Converts a family to be face-host based.
Plumbing Extensions
- ConnectPipePlaceholdersAtElbow: Connects pipe placeholders that form an elbow connection.
- ConnectPipePlaceholdersAtTee: Connects pipe placeholders to form a Tee connection.
- ConnectPipePlaceholdersAtCross: Connects pipe placeholders to form a Cross connection.
- PlaceCapOnOpenEnds: Places caps on open pipe connectors.
- HasOpenConnector: Checks if a pipe curve has an open piping connector.
- BreakCurve: Splits a pipe curve at a specified point.
Element Solid Cut Extensions
- GetCuttingSolids: Retrieves solids that cut a given element.
- GetSolidsBeingCut: Returns solids that are cut by the given element.
- IsAllowedForSolidCut: Verifies if the element can be involved in a solid-solid cut.
- IsElementFromAppropriateContext: Checks if the element belongs to a suitable context for solid cuts.
- CanElementCutElement: Determines whether a cutting element can create a solid cut on a target element.
- CutExistsBetweenElements: Checks if there is an existing solid-solid cut between two elements.
- AddCutBetweenSolids: Adds a solid-solid cut between two elements.
- RemoveCutBetweenSolids: Removes an existing solid cut between two elements.
- SplitFacesOfCuttingSolid: Splits the faces of a cutting solid element.
View Extensions
- GetTransformFromViewToView: Returns a transformation to copy elements between two views.
View Managers Extensions
- CreateSpatialFieldManager: Creates a SpatialField manager for a given view.
- GetSpatialFieldManager: Retrieves the SpatialField manager for a specific view.
Ribbon Extensions
- AddStackPanel: Adds a vertical stack panel to the specified Ribbon panel.
- AddPushButton: Adds a PushButton to the vertical stack panel.
- AddPullDownButton: Adds a PullDownButton to the vertical stack panel.
- AddSplitButton: Adds a SplitButton to the vertical stack panel.
- AddComboBox: Adds a ComboBox to the vertical stack panel.
- AddTextBox: Adds a TextBox to the vertical stack panel.
Breaking changes
- ToFraction: Now uses "8" precision, instead of "32".
- ToFraction: Now suppress "0" for inches part.
- SetAvailabilityController: Now returns
PushButton
instead ofRibbonButton
.
Readme has been updated, you can find a detailed description and code samples in it.
Full changelog: 2025.0.1-preview.2.0...2025.0.1-preview.2.1
2025.0.1-preview.2.0
This update focuses on increased utility class coverage, new extensions for global parameter management, for ForgeTypeId handling, advanced geometry extensions, and many-many more.
New Extensions
Element Association Extensions
- IsAnalyticalElement: Determines whether an element is an analytical element.
- IsPhysicalElement: Checks if an element is a physical one.
Element Worksharing Extensions
- GetCheckoutStatus: Retrieves the ownership status of an element, with an optional parameter to return the owner's name.
- GetWorksharingTooltipInfo: Provides worksharing information about an element for in-canvas tooltips.
- GetModelUpdatesStatus: Gets the status of an element in the central model.
ElementId Extensions
- ToElements: Retrieves a collection of Elements associated with the specified ElementIds.
- ToElements: Retrieves a collection of Elements associated with the specified ElementIds as the specified type T.
- ToOrderedElements: Retrieves the Elements associated with the specified ElementIds in their original order.
- ToOrderedElements: Retrieves the Elements associated with the specified ElementIds and casts them to the specified type T in their original order.
ElementId Transform Extensions
- CanMirrorElements: Verifies whether a set of elements can be mirrored.
- MirrorElements: Mirrors elements across a plane, with support for mirrored copies.
- MoveElements: Moves elements according to a specified transformation.
- RotateElements: Rotates elements around a given axis by a specified angle.
- CopyElements: Copies elements between views or within the same document, with options for translation and transformation.
Document Extensions
- GetProfileSymbols: Returns profile family symbols in the document.
- RelinquishOwnership: Allows relinquishment of ownership based on specified options.
Document Managers Extensions
- GetTemporaryGraphicsManager: Fetches a reference to the document’s temporary graphics manager.
- GetAnalyticalToPhysicalAssociationManager: Retrieves the manager for analytical-to-physical element associations.
- GetLightGroupManager: Creates or retrieves the light group manager for the document.
Geometry Extensions
- Contains: Determines if a point or another bounding box is contained within the bounding box, with strict mode available for more precise containment checks.
- Overlaps: Checks whether two bounding boxes overlap.
- ComputeCentroid: Calculates the geometric center of a bounding box.
- ComputeVertices: Returns the coordinates of the eight vertices of a bounding box.
- ComputeVolume: Computes the volume enclosed by the bounding box.
- ComputeSurfaceArea: Calculates the total surface area of the bounding box.
Parameters Extensions
- IsBuiltInParameter: Verifies if a parameter is a built-in parameter.
Document Global Parameters Extensions
- FindGlobalParameter: Locates a global parameter by name in the document.
- GetAllGlobalParameters: Returns all global parameters in the document.
- GetGlobalParametersOrdered: Retrieves ordered global parameters.
- SortGlobalParameters: Sorts global parameters in the specified order.
- MoveUpOrder: Moves a global parameter up in the order.
- MoveDownOrder: Moves a global parameter down in the order.
- IsUniqueGlobalParameterName: Checks if a global parameter name is unique.
- IsValidGlobalParameter: Validates if an ElementId is a global parameter.
- AreGlobalParametersAllowed: Checks if global parameters are permitted in the document.
ForgeTypeId Extensions
- IsSpec: Validates if a ForgeTypeId identifies a spec.
- IsBuiltInGroup: Determines whether a ForgeTypeId identifies a built-in parameter group.
- IsBuiltInParameter: Validates if a ForgeTypeId identifies a built-in parameter.
- IsSymbol: Checks if a ForgeTypeId identifies a symbol.
- IsUnit: Verifies if a ForgeTypeId identifies a unit.
- IsValidDataType: Determines if a ForgeTypeId identifies a valid parameter data type.
- IsValidUnit: Validates if a unit is valid for a measurable spec.
- IsMeasurableSpec: Checks if a ForgeTypeId represents a measurable spec.
- GetBuiltInParameter: Retrieves a BuiltInParameter from a ForgeTypeId.
- GetParameterTypeId: Fetches the ForgeTypeId corresponding to a BuiltInParameter.
- GetDiscipline: Gets the discipline for a measurable spec.
- GetValidUnits: Retrieves all valid units for a measurable spec.
- GetTypeCatalogStringForSpec: Fetches the type catalog string for a measurable spec.
- GetTypeCatalogStringForUnit: Retrieves the type catalog string for a unit.
- DownloadCompanyName: Downloads the owning company name for a parameter and records it in the document.
- DownloadParameterOptions: Fetches settings related to a parameter from the Parameters Service.
- DownloadParameter: Creates a shared parameter element in a document based on a downloaded parameter definition.
Color Extensions
- ToHex: Converts a color to its hexadecimal representation.
- ToHexInteger: Returns the hexadecimal integer representation of a color.
- ToRgb: Provides the RGB representation of a color.
- ToHsl: Converts a color to its HSL representation.
- ToHsv: Converts a color to its HSV representation.
- ToCmyk: Retrieves the CMYK representation of a color.
- ToHsb: Converts a color to HSB.
- ToHsi: Converts a color to HSI format.
- ToHwb: Provides the HWB representation of a color.
- ToNCol: Converts a color to NCol format.
- ToCielab: Retrieves the Cielab representation of a color.
- ToCieXyz: Converts a color to CieXyz format.
- ToFloat: Returns the float representation of a color.
- ToDecimal: Returns the decimal representation of a color.
Family Extensions
- CanConvertToFaceHostBased: Indicates whether a family can be converted to a face-hosted version.
- ConvertToFaceHostBased: Converts a family to be face-host based.
Plumbing Extensions
- ConnectPipePlaceholdersAtElbow: Connects pipe placeholders that form an elbow connection.
- ConnectPipePlaceholdersAtTee: Connects pipe placeholders to form a Tee connection.
- ConnectPipePlaceholdersAtCross: Connects pipe placeholders to form a Cross connection.
- PlaceCapOnOpenEnds: Places caps on open pipe connectors.
- HasOpenConnector: Checks if a pipe curve has an open piping connector.
- BreakCurve: Splits a pipe curve at a specified point.
Element Solid Cut Extensions
- GetCuttingSolids: Retrieves solids that cut a given element.
- GetSolidsBeingCut: Returns solids that are cut by the given element.
- IsAllowedForSolidCut: Verifies if the element can be involved in a solid-solid cut.
- IsElementFromAppropriateContext: Checks if the element belongs to a suitable context for solid cuts.
- CanElementCutElement: Determines whether a cutting element can create a solid cut on a target element.
- CutExistsBetweenElements: Checks if there is an existing solid-solid cut between two elements.
- AddCutBetweenSolids: Adds a solid-solid cut between two elements.
- RemoveCutBetweenSolids: Removes an existing solid cut between two elements.
- SplitFacesOfCuttingSolid: Splits the faces of a cutting solid element.
View Extensions
- GetTransformFromViewToView: Returns a transformation to copy elements between two views.
View Managers Extensions
- CreateSpatialFieldManager: Creates a SpatialField manager for a given view.
- GetSpatialFieldManager: Retrieves the SpatialField manager for a specific view.
Ribbon Extensions
- AddStackPanel: Adds a vertical stack panel to the specified Ribbon panel.
- AddPushButton: Adds a PushButton to the vertical stack panel.
- AddPullDownButton: Adds a PullDownButton to the vertical stack panel.
- AddSplitButton: Adds a SplitButton to the vertical stack panel.
- AddComboBox: Adds a ComboBox to the vertical stack panel.
- AddTextBox: Adds a TextBox to the vertical stack panel.
Breaking changes
- ToFraction: Now uses 8 precision, instead of 32
- ToFraction: Now suppress 0 for inches part
- SetAvailabilityController: Now returns PushButton instead of RibbonButton
Readme file has been updated, you can find a detailed description and code samples in it
Full changelog: 2025.0.1-preview.1.0...2025.0.1-preview.2.0
2025.0.1-preview.1.0
This update focuses on increased utility class coverage, new extensions for global parameter management, for ForgeTypeId handling, advanced geometry extensions, and many-many more.
Element Association Extensions
- IsAnalyticalElement: Determines whether an element is an analytical element.
- IsPhysicalElement: Checks if an element is a physical one.
Element Worksharing Extensions
- GetCheckoutStatus: Retrieves the ownership status of an element, with an optional parameter to return the owner's name.
- GetWorksharingTooltipInfo: Provides worksharing information about an element for in-canvas tooltips.
- GetModelUpdatesStatus: Gets the status of an element in the central model.
ElementId Transform Extensions
- CanMirrorElements: Verifies whether a set of elements can be mirrored.
- MirrorElements: Mirrors elements across a plane, with support for mirrored copies.
- MoveElements: Moves elements according to a specified transformation.
- RotateElements: Rotates elements around a given axis by a specified angle.
- CopyElements: Copies elements between views or within the same document, with options for translation and transformation.
Application Extensions
- SetMacroSecurityOptions: Configures macro security settings.
- GetMacroSecurityOptions: Retrieves the current macro security options.
- GetMacroManager: Provides access to the Macro Manager for the current application.
Document Extensions
- GetProfileSymbols: Returns profile family symbols in the document.
- RelinquishOwnership: Allows relinquishment of ownership based on specified options.
Document Managers Extensions
- GetTemporaryGraphicsManager: Fetches a reference to the document’s temporary graphics manager.
- GetAnalyticalToPhysicalAssociationManager: Retrieves the manager for analytical-to-physical element associations.
- GetLightGroupManager: Creates or retrieves the light group manager for the document.
Geometry Extensions
- Contains: Determines if a point or another bounding box is contained within the bounding box, with strict mode available for more precise containment checks.
- Overlaps: Checks whether two bounding boxes overlap.
- ComputeCentroid: Calculates the geometric center of a bounding box.
- ComputeVertices: Returns the coordinates of the eight vertices of a bounding box.
- ComputeVolume: Computes the volume enclosed by the bounding box.
- ComputeSurfaceArea: Calculates the total surface area of the bounding box.
Parameters Extensions
- IsBuiltInParameter: Verifies if a parameter is a built-in parameter.
Document Global Parameters Extensions
- FindGlobalParameter: Locates a global parameter by name in the document.
- GetAllGlobalParameters: Returns all global parameters in the document.
- GetGlobalParametersOrdered: Retrieves ordered global parameters.
- SortGlobalParameters: Sorts global parameters in the specified order.
- MoveGlobalParameterUpOrder: Moves a global parameter up in the order.
- MoveGlobalParameterDownOrder: Moves a global parameter down in the order.
- IsUniqueGlobalParameterName: Checks if a global parameter name is unique.
- IsValidGlobalParameter: Validates if an ElementId is a global parameter.
- AreGlobalParametersAllowed: Checks if global parameters are permitted in the document.
ForgeTypeId Extensions
- IsSpec: Validates if a ForgeTypeId identifies a spec.
- IsBuiltInGroup: Determines whether a ForgeTypeId identifies a built-in parameter group.
- IsBuiltInParameter: Validates if a ForgeTypeId identifies a built-in parameter.
- IsSymbol: Checks if a ForgeTypeId identifies a symbol.
- IsUnit: Verifies if a ForgeTypeId identifies a unit.
- IsValidDataType: Determines if a ForgeTypeId identifies a valid parameter data type.
- IsValidUnit: Validates if a unit is valid for a measurable spec.
- IsMeasurableSpec: Checks if a ForgeTypeId represents a measurable spec.
- GetBuiltInParameter: Retrieves a BuiltInParameter from a ForgeTypeId.
- GetParameterTypeId: Fetches the ForgeTypeId corresponding to a BuiltInParameter.
- GetDiscipline: Gets the discipline for a measurable spec.
- GetValidUnits: Retrieves all valid units for a measurable spec.
- GetTypeCatalogStringForSpec: Fetches the type catalog string for a measurable spec.
- GetTypeCatalogStringForUnit: Retrieves the type catalog string for a unit.
- DownloadCompanyName: Downloads the owning company name for a parameter and records it in the document.
- DownloadParameterOptions: Fetches settings related to a parameter from the Parameters Service.
- DownloadParameter: Creates a shared parameter element in a document based on a downloaded parameter definition.
Color Extensions
- ToHex: Converts a color to its hexadecimal representation.
- ToHexInteger: Returns the hexadecimal integer representation of a color.
- ToRgb: Provides the RGB representation of a color.
- ToHsl: Converts a color to its HSL representation.
- ToHsv: Converts a color to its HSV representation.
- ToCmyk: Retrieves the CMYK representation of a color.
- ToHsb: Converts a color to HSB.
- ToHsi: Converts a color to HSI format.
- ToHwb: Provides the HWB representation of a color.
- ToNCol: Converts a color to NCol format.
- ToCielab: Retrieves the Cielab representation of a color.
- ToCieXyz: Converts a color to CieXyz format.
- ToFloat: Returns the float representation of a color.
- ToDecimal: Returns the decimal representation of a color.
Family Extensions
- CanConvertToFaceHostBased: Indicates whether a family can be converted to a face-hosted version.
- ConvertToFaceHostBased: Converts a family to be face-host based.
Plumbing Extensions
- ConnectPipePlaceholdersAtElbow: Connects pipe placeholders that form an elbow connection.
- ConnectPipePlaceholdersAtTee: Connects pipe placeholders to form a Tee connection.
- ConnectPipePlaceholdersAtCross: Connects pipe placeholders to form a Cross connection.
- PlaceCapOnOpenEnds: Places caps on open pipe connectors.
- HasOpenConnector: Checks if a pipe curve has an open piping connector.
- BreakCurve: Splits a pipe curve at a specified point.
Element Solid Cut Extensions
- GetCuttingSolids: Retrieves solids that cut a given element.
- GetSolidsBeingCut: Returns solids that are cut by the given element.
- IsAllowedForSolidCut: Verifies if the element can be involved in a solid-solid cut.
- IsElementFromAppropriateContext: Checks if the element belongs to a suitable context for solid cuts.
- CanElementCutElement: Determines whether a cutting element can create a solid cut on a target element.
- CutExistsBetweenElements: Checks if there is an existing solid-solid cut between two elements.
- AddCutBetweenSolids: Adds a solid-solid cut between two elements.
- RemoveCutBetweenSolids: Removes an existing solid cut between two elements.
- SplitFacesOfCuttingSolid: Splits the faces of a cutting solid element.
View Extensions
- GetTransformFromViewToView: Returns a transformation to copy elements between two views.
View Managers Extensions
- CreateSpatialFieldManager: Creates a SpatialField manager for a given view.
- GetSpatialFieldManager: Retrieves the SpatialField manager for a specific view.
Part Extensions
- GetSplittingElements: Identifies elements used to create parts.
- GetSplittingCurves: Identifies curves used to create parts and the plane they reside in.
- GetChainLengthToOriginal: Calculates the chain length from a part to its original element.
- GetMergedParts: Retrieves element IDs of merged parts.
- IsPartDerivedFromLink: Checks if a part originates from linked geometry.
Full changelog: 2025.0.0...2025.0.1-preview.1.0
2025.0.0
- Revit 2025 support
- New
FindParameter()
overloads with GUID and Definition. This method combines all API methods for getting a parameter, such asget_Parameter
,LookupParameter
,GetParameter
. It also searches for a parameter in the element type if there is no such parameter in the element GetParameter()
method is obsolete. UseFindParameter()
instead- New extensions to help you add context menu items without creating additional classes or specifying type names. Revit 2025 and higher
The ConfigureContextMenu() method 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");
});
The AddMenuItem() method adds a menu item to the Context Menu.
menu.AddMenuItem<Command>("Menu title");
The AddSeparator() method adds a separator to the Context Menu.
menu.AddSeparator();
The AddSubMenu() method 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);
The SetAvailabilityController() method specifies the class type that decides the availability of menu item.
menuItem.SetAvailabilityController<Controller>()
Full changelog: 2024.0.0...2025.0.0
2024.0.0
Revit 2024 support
2023.1.9
ElementExtensions:
- Method chain support
ElementIdExtensions:
- Fixed cast operations. Directly cast used by default (safe cast early)
SchemaExtensions:
- SaveEntity now return bool if the entity save was successful
SystemExtensions:
- AppendPath overload with params
2023.1.8
UnitExtensions:
- New FromUnit extension
- New ToUnit extension
2023.1.7
RibbonExtensions:
- New SetAvailabilityController() extension
ParameterExtensions:
- New Set(bool) extension
- New Set(color) extension
Nuget symbol server support: https://symbols.nuget.org/download/symbols
2023.1.6
CollectorExtensions:
- New GetElements(ElementId viewId) extension
- New GetElements(ICollection elementIds) extension
- New overloads for instances with ViewId
2023.1.5
New Parameter extensions
Fixed GetParameter extensions for cases where the parameter value was not initialized