ChangeService Method (ISet(ElementId), Int32, Int32, Boolean)


Changes the service of the selection of fabrication parts.

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

Syntax

C#
public FabricationNetworkChangeServiceResult ChangeService(
	ISet<ElementId> selection,
	int serviceId,
	int paletteId,
	bool restrictPalette
)
Visual Basic
Public Function ChangeService ( _
	selection As ISet(Of ElementId), _
	serviceId As Integer, _
	paletteId As Integer, _
	restrictPalette As Boolean _
) As FabricationNetworkChangeServiceResult
Visual C++
public:
FabricationNetworkChangeServiceResult ChangeService(
	ISet<ElementId^>^ selection, 
	int serviceId, 
	int paletteId, 
	bool restrictPalette
)

Parameters

selection
Type: System.Collections.Generic ISet ElementId
The set of element identifiers of fabrication parts to change the service for.
serviceId
Type: System Int32
The identifier of the fabrication service.
paletteId
Type: System Int32
The identifier of the fabrication palette.
restrictPalette
Type: System Boolean
Restrict the placement of parts to the passed in palette identifier.

Remarks

After this method has been invoked, call:

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The selection contains invalid elements to change.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions InvalidOperationException No fabrication configuration is loaded.

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →