Table of Contents

Class Conduit

Namespace
OpenMEPRevit.Element
Assembly
OpenMEPRevit.dll

This class represents a conduit in Autodesk Revit.

public class Conduit
Inheritance
Conduit
Inherited Members

Methods

CreateByLine(Element, Line, Element)

Create a conduit by line

[NodeCategory("Create")]
public static Element? CreateByLine(Element conduitType, Line line, Element level)

Parameters

conduitType Element

The conduit type. This must be a conduit type accepted by isValidConduitType(). If the input conduit type is InvalidElementId, the default conduit type from the document will be used.

line Line

the line define to draw conduit from start point to end point

level Element

the element of level

Returns

Element

new conduit

Examples

CreateByLine(Element, Line, Element, double)

Create a conduit by line

[NodeCategory("Create")]
public static Element? CreateByLine(Element conduitType, Line line, Element level, double diameter)

Parameters

conduitType Element

The conduit type. This must be a conduit type accepted by isValidConduitType(). If the input conduit type is InvalidElementId, the default conduit type from the document will be used.

line Line

the line define to draw conduit from start point to end point

level Element

the element of level

diameter double

the value diameter of conduit

Returns

Element

new conduit

Examples

CreateByTwoConnector(Element, Connector, Connector, Element)

Creates a new instance of conduit.

[NodeCategory("Create")]
public static Element? CreateByTwoConnector(Element conduitType, Connector firstConnector, Connector secondConnector, Element level)

Parameters

conduitType Element

The conduit type. This must be a conduit type accepted by isValidConduitType(). If the input conduit type is InvalidElementId, the default conduit type from the document will be used.

firstConnector Connector

The first connector to get start point

secondConnector Connector

The second connector to get endpoint

level Element

The element of the level which this conduit based. If the input level id is invalidElementId = -1, the nearest level will be used.

Returns

Element

The newly created conduit.

Examples

Remarks

This method will regenerate the document.

Exceptions

ArgumentException

This conduit type is invalid. -or- This level id is invalid. -or- The points of startPoint and endPoint are too close: for MEPCurve, the minimum length is 1/10 inch.

ArgumentNullException

A non-optional argument was null

DisabledDisciplineException

None of the following disciplines is enabled: Mechanical Electrical Piping.

InvalidOperationException

The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements).

ModificationForbiddenException

The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process.

ModificationOutsideTransactionException

The document has no open transaction.

CreateByTwoConnector(Element, Connector, Connector, Element, double)

Creates a new instance of conduit.

[NodeCategory("Create")]
public static Element? CreateByTwoConnector(Element conduitType, Connector firstConnector, Connector secondConnector, Element level, double diameter)

Parameters

conduitType Element

The conduit type. This must be a conduit type accepted by isValidConduitType(). If the input conduit type is InvalidElementId, the default conduit type from the document will be used.

firstConnector Connector

The first connector to get start point

secondConnector Connector

The second connector to get endpoint

level Element

The element of the level which this conduit based. If the input level id is invalidElementId = -1, the nearest level will be used.

diameter double

the value diameter of conduit

Returns

Element

The newly created conduit.

Examples

Remarks

This method will regenerate the document.

Exceptions

ArgumentException

This conduit type is invalid. -or- This level id is invalid. -or- The points of startPoint and endPoint are too close: for MEPCurve, the minimum length is 1/10 inch.

ArgumentNullException

A non-optional argument was null

DisabledDisciplineException

None of the following disciplines is enabled: Mechanical Electrical Piping.

InvalidOperationException

The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements).

ModificationForbiddenException

The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process.

ModificationOutsideTransactionException

The document has no open transaction.

CreateByTwoPoint(Element, Point, Point, Element)

Creates a new instance of conduit.

[NodeCategory("Create")]
public static Element? CreateByTwoPoint(Element conduitType, Point startPoint, Point endPoint, Element level)

Parameters

conduitType Element

The conduit type. This must be a conduit type accepted by isValidConduitType(). If the input conduit type is InvalidElementId, the default conduit type from the document will be used.

startPoint Point

The start point of the conduit location line.

endPoint Point

The end point of the conduit location line.

level Element

The element of the level which this conduit based. If the input level id is invalidElementId = -1, the nearest level will be used.

Returns

Element

The newly created conduit.

Examples

Remarks

This method will regenerate the document.

Exceptions

ArgumentException

This conduit type is invalid. -or- This level id is invalid. -or- The points of startPoint and endPoint are too close: for MEPCurve, the minimum length is 1/10 inch.

ArgumentNullException

A non-optional argument was null

DisabledDisciplineException

None of the following disciplines is enabled: Mechanical Electrical Piping.

InvalidOperationException

The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements).

ModificationForbiddenException

The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process.

ModificationOutsideTransactionException

The document has no open transaction.

CreateByTwoPoint(Element, Point, Point, Element, double)

Creates a new instance of conduit.

[NodeCategory("Create")]
public static Element? CreateByTwoPoint(Element conduitType, Point startPoint, Point endPoint, Element level, double diameter)

Parameters

conduitType Element

The conduit type. This must be a conduit type accepted by isValidConduitType(). If the input conduit type is InvalidElementId, the default conduit type from the document will be used.

startPoint Point

The start point of the conduit location line.

endPoint Point

The end point of the conduit location line.

level Element

The element of the level which this conduit based. If the input level id is invalidElementId = -1, the nearest level will be used.

diameter double

diameter value of conduit

Returns

Element

The newly created conduit.

Examples

Remarks

This method will regenerate the document.

Exceptions

ArgumentException

This conduit type is invalid. -or- This level id is invalid. -or- The points of startPoint and endPoint are too close: for MEPCurve, the minimum length is 1/10 inch.

ArgumentNullException

A non-optional argument was null

DisabledDisciplineException

None of the following disciplines is enabled: Mechanical Electrical Piping.

InvalidOperationException

The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements).

ModificationForbiddenException

The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process.

ModificationOutsideTransactionException

The document has no open transaction.

SetDiameter(Element?, double)

Set diameter of conduit

public static Element? SetDiameter(Element? conduit, double diameter)

Parameters

conduit Element

conduit need to set

diameter double

diameter to set

Returns

Element

conduit

Examples

Exceptions

Exception