InsertVertex Method


Inserts a new vertex before the specified index.

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 InsertVertex(
	int index,
	XYZ vertexPoint
)
Visual Basic
Public Sub InsertVertex ( _
	index As Integer, _
	vertexPoint As XYZ _
)
Visual C++
public:
void InsertVertex(
	int index, 
	XYZ^ vertexPoint
)

Parameters

index
Type: SystemInt32
The index of the vertex to come after this new vertex. Should be between 0 and NumberOfVertices.
vertexPoint
Type: Autodesk.Revit.DBXYZ
The point of the new vertex.

Remarks

To add a new vertex to the end of the wire, use AppendVertex(XYZ).

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 insert the vertex before the start vertex if the start point connects to one element.

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 →