SetVertex Method


Sets the position of a given vertex. If the vertex is start or end point, and the wire connects to electrical device, the wire end offset will be set according to the given vertex. If the vertex is start or end point, and the wire connects to other wire, user can't set the vertex and exception will be thrown. If the vertex is start or end point, and the wire connects to nothing, the vertex will be set as the given vertex.

Namespace: Autodesk.Revit.DB.Electrical
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2015

Syntax

C#
public void SetVertex(
	int index,
	XYZ vertexPoint
)
Visual Basic
Public Sub SetVertex ( _
	index As Integer, _
	vertexPoint As XYZ _
)
Visual C++
public:
void SetVertex(
	int index, 
	XYZ^ vertexPoint
)

Parameters

index
Type: SystemInt32
The index of the existing vertex. Should be between 0 and NumberOfVertices.
vertexPoint
Type: Autodesk.Revit.DBXYZ
The new position for the vertex.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException The index should be between 0 and the number of vertices of the wire. -or- The vertex point cannot be added to the wire because there is already a vertex at this position on the view plane (within tolerance).
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsDisabledDisciplineException None of the following disciplines is enabled: Mechanical Electrical Piping.
Autodesk.Revit.ExceptionsInvalidOperationException Can't set the vertex when the vertex is start or end point and the wire connects to other wire.

See Also