Creates a new style object, adds it to the collection, and returns an ObjectId for the object.
Namespace: Autodesk.Civil.DatabaseServices.StylesAssembly: AeccPressurePipesMgd (in AeccPressurePipesMgd.dll) Version: 13.4.2516.0
Syntax
C# |
---|
public override sealed ObjectId Add(
string name
) |
Visual Basic |
---|
Public Overrides NotOverridable Function Add ( _
name As String _
) As ObjectId |
Visual C++ |
---|
public:
virtual ObjectId Add(
String^ name
) override sealed |
Parameters
- name
- Type: System..::..String
The name of the new style. If this string is empty or null, a dynamically generated name is created.
Examples
CopyC#
1
2
3ObjectId surfaceStyleId = ObjectId.Null;
4try
5{
6 surfaceStyleId = doc.Styles.SurfaceStyles["Slope Banding (2D)"];
7}
8catch (System.ArgumentException e)
9{
10 surfaceStyleId = doc.Styles.SurfaceStyles.Add("Slope Banding (2D)");
11}
Exceptions
Exception | Condition |
---|
System..::..ArgumentException |
Thrown when the name already exists.
|
See Also