ChannelCreateFromAlignment(String, ObjectId, ObjectId) Method |
Create channel from alignment and profile.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDrainageDesignMgd (in AeccDrainageDesignMgd.dll) Version: 13.9.960.0
Syntaxpublic static ObjectId CreateFromAlignment(
string channelName,
ObjectId alignmentId,
ObjectId profileId
)
Public Shared Function CreateFromAlignment (
channelName As String,
alignmentId As ObjectId,
profileId As ObjectId
) As ObjectId
public:
static ObjectId CreateFromAlignment(
String^ channelName,
ObjectId alignmentId,
ObjectId profileId
)
Parameters
- channelName String
- Name of the channel to be created.
- alignmentId ObjectId
- Object id of the alignment used to create channel.
- profileId ObjectId
- Object id of the profile used to create channel.
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.
- Alignment object id is invalid.
- Profile object id is invalid.
- The profile doesn't belong to the alignment.
|
| ArgumentNullException |
Thrown when the specified channel name string is null.
|
Example
This example shows how to create a channel from an alignment.
1ObjectId alignmentId = CivilDocument.GetCivilDocument(m_Database).GetAlignmentIds()[0];
2ObjectId profileId = (alignmentId.GetObject(OpenMode.ForRead) as Alignment).GetProfileIds()[0];
3
4ObjectId channelId = Channel.CreateFromAlignment("channel name", alignmentId, profileId);
See Also