ChannelCreateFromFeatureLine(String, ObjectId, TupleDouble, Double, ObjectId, ObjectId) Method |
Create channel from feature line with more options.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDrainageDesignMgd (in AeccDrainageDesignMgd.dll) Version: 13.9.960.0
Syntaxpublic static ObjectId CreateFromFeatureLine(
string channelName,
ObjectId featureLineId,
Tuple<double, double> stationRange,
ObjectId channelStyleId,
ObjectId layerId
)
Public Shared Function CreateFromFeatureLine (
channelName As String,
featureLineId As ObjectId,
stationRange As Tuple(Of Double, Double),
channelStyleId As ObjectId,
layerId As ObjectId
) As ObjectId
public:
static ObjectId CreateFromFeatureLine(
String^ channelName,
ObjectId featureLineId,
Tuple<double, double>^ stationRange,
ObjectId channelStyleId,
ObjectId layerId
)
Parameters
- channelName String
- Name of the channel to be created.
- featureLineId ObjectId
- Object id of the feature line used to create channel.
- stationRange TupleDouble, Double
- Station range of channel's start/end station. If it's null, then no specified station range.
- channelStyleId ObjectId
- Channel style object id of the channel to be created. If it's Null object id, then a default channel style is used.
- layerId ObjectId
- Layer object id of the channel to be created. If it's Null object id, then a default layer is used.
Return Value
ObjectIdObject id of the channel created.
Exceptions| Exception | Condition |
|---|
| BackwardCompatibilityException |
Thrown when getting/setting value and data is not compatible with the current version of the channel. Try to fix by upgrading the channel.
|
| ForwardCompatibilityException |
Thrown when getting/setting value and data is not compatible with the current version of the channel. Try to fix by opening the drawing in a newer version of the product.
|
| ArgumentException |
Thrown when:
- Channel name is empty.
- Channel name is duplicate.
- Channel name contains invalid character.
- Feature line object id is invalid.
- Station range start is bigger than or equal to station range end.
- Channel style object id is invalid.
- Layer object id is invalid.
|
| ArgumentNullException |
Thrown when the specified channel name string is null.
|
| ArgumentOutOfRangeException |
Thrown when:
- Station range start is out of station range of the baseline.
- Station range end is out of station range of the baseline.
|
Example
This example shows how to create a channel from a feature line.
1ObjectId featureLineId = CivilDocument.GetCivilDocument(m_Database).GetSitelessFeatureLineIds()[0];
2
3Tuple<double, double> stationRange = new Tuple<double, double> (100, 3000);
4ObjectId sytleId = CivilApplication.ActiveDocument.Styles.GetChannelStyles()["Standard"];
5ObjectId layerId = (m_Database.LayerTableId.GetObject(OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.LayerTable)["0"];
6
7ObjectId channelId = Channel.CreateFromFeatureLine("channel name", featureLineId, stationRange, sytleId, layerId);
See Also