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
ElementThe 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
Linethe line define to draw conduit from start point to end point
level
Elementthe 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
ElementThe 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
Linethe line define to draw conduit from start point to end point
level
Elementthe element of level
diameter
doublethe 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
ElementThe 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
ConnectorThe first connector to get start point
secondConnector
ConnectorThe second connector to get endpoint
level
ElementThe 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
ElementThe 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
ConnectorThe first connector to get start point
secondConnector
ConnectorThe second connector to get endpoint
level
ElementThe element of the level which this conduit based. If the input level id is invalidElementId = -1, the nearest level will be used.
diameter
doublethe 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
ElementThe 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
PointThe start point of the conduit location line.
endPoint
PointThe end point of the conduit location line.
level
ElementThe 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
ElementThe 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
PointThe start point of the conduit location line.
endPoint
PointThe end point of the conduit location line.
level
ElementThe element of the level which this conduit based. If the input level id is invalidElementId = -1, the nearest level will be used.
diameter
doublediameter 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
Elementconduit need to set
diameter
doublediameter to set
Returns
- Element
conduit