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
conduitTypeElementThe 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.
lineLinethe line define to draw conduit from start point to end point
levelElementthe 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
conduitTypeElementThe 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.
lineLinethe line define to draw conduit from start point to end point
levelElementthe element of level
diameterdoublethe 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
conduitTypeElementThe 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.
firstConnectorConnectorThe first connector to get start point
secondConnectorConnectorThe second connector to get endpoint
levelElementThe 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
conduitTypeElementThe 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.
firstConnectorConnectorThe first connector to get start point
secondConnectorConnectorThe second connector to get endpoint
levelElementThe element of the level which this conduit based. If the input level id is invalidElementId = -1, the nearest level will be used.
diameterdoublethe 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
conduitTypeElementThe 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.
startPointPointThe start point of the conduit location line.
endPointPointThe end point of the conduit location line.
levelElementThe 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
conduitTypeElementThe 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.
startPointPointThe start point of the conduit location line.
endPointPointThe end point of the conduit location line.
levelElementThe element of the level which this conduit based. If the input level id is invalidElementId = -1, the nearest level will be used.
diameterdoublediameter 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
conduitElementconduit need to set
diameterdoublediameter to set
Returns
- Element
conduit
Examples
