GetUnitGroup Method (ForgeTypeId)


Gets the unit group for a given spec.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2014

Syntax

C#
[ObsoleteAttribute("This method is deprecated in Revit 2022 and may be removed in a future version of Revit. Please use the `GetDiscipline(ForgeTypeId)` method instead.")]
public static UnitGroup GetUnitGroup(
	ForgeTypeId specTypeId
)
Visual Basic
<ObsoleteAttribute("This method is deprecated in Revit 2022 and may be removed in a future version of Revit. Please use the `GetDiscipline(ForgeTypeId)` method instead.")> _
Public Shared Function GetUnitGroup ( _
	specTypeId As ForgeTypeId _
) As UnitGroup
Visual C++
[ObsoleteAttribute(L"This method is deprecated in Revit 2022 and may be removed in a future version of Revit. Please use the `GetDiscipline(ForgeTypeId)` method instead.")]
public:
static UnitGroup GetUnitGroup(
	ForgeTypeId^ specTypeId
)

Parameters

specTypeId
Type: Autodesk.Revit.DB ForgeTypeId
Identifier of the spec.

Return Value

The unit group.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException specTypeId is not a measurable spec identifier. See UnitUtils.IsMeasurableSpec(ForgeTypeId).
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →