Creates a profile of FG type.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.4.2516.0

Syntax

C#
public static ObjectId CreateByLayout(
	string profileName,
	ObjectId alignmentId,
	ObjectId layerId,
	ObjectId styleId,
	ObjectId labelSetId
)
Visual Basic
Public Shared Function CreateByLayout ( _
	profileName As String, _
	alignmentId As ObjectId, _
	layerId As ObjectId, _
	styleId As ObjectId, _
	labelSetId As ObjectId _
) As ObjectId
Visual C++
public:
static ObjectId CreateByLayout(
	String^ profileName, 
	ObjectId alignmentId, 
	ObjectId layerId, 
	ObjectId styleId, 
	ObjectId labelSetId
)

Parameters

profileName
Type: System..::..String
Name for the new profile, make sure this name is not used by another profile under the specified alignment
alignmentId
Type: ObjectId
Alignment id to place the new profile, OBJECTID TYPE: Autodesk.Civil.DatabaseServices.Alignment
layerId
Type: ObjectId
Layer id to place the new profile, OBJECTID TYPE: Autodesk.AutoCAD.DatabaseServices.LayerTableRecord
styleId
Type: ObjectId
Style id to apply to the new profile, OBJECTID TYPE: Autodesk.Civil.DatabaseServices.Styles.AlignmentStyle
labelSetId
Type: ObjectId
LabelSet id to apply to the new profile, OBJECTID TYPE: Autodesk.Civil.DatabaseServices.Styles.AlignmentLabelSetStyle

Remarks

OBJECTID TYPE: Autodesk.Civil.DatabaseServices.Profile

Examples

CopyC#
 1Alignment oAlignment = ts.GetObject(alignID, OpenMode.ForRead) as Alignment;
 2
 3// use the same layer as the alignment
 4ObjectId layerId = oAlignment.LayerId;
 5// get the standard style and label set 
 6// these calls will fail on templates without a style named "Standard"
 7ObjectId styleId = doc.Styles.ProfileStyles["Standard"];
 8ObjectId labelSetId = doc.Styles.LabelSetStyles.ProfileLabelSetStyles["Standard"];
 9
10ObjectId oProfileId = Profile.CreateByLayout("My Profile", alignID, layerId, styleId, labelSetId);

Exceptions

ExceptionCondition
System..::..ArgumentException Thrown when:
  1. profileName is either null, blank, or existed under the specified alignment.
  2. alignmentId, layerId, styleId, or labelsetId is invalid.

See Also