Creates a new instance of a TinVolumeSurface and adds it to the database where the surface specified by baseSurfaceId is located.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.4.2516.0
Syntax
C# |
---|
public static ObjectId Create(
string surfaceName,
ObjectId baseSurfaceId,
ObjectId comparisonSurfaceId
) |
Visual Basic |
---|
Public Shared Function Create ( _
surfaceName As String, _
baseSurfaceId As ObjectId, _
comparisonSurfaceId As ObjectId _
) As ObjectId |
Visual C++ |
---|
public:
static ObjectId Create(
String^ surfaceName,
ObjectId baseSurfaceId,
ObjectId comparisonSurfaceId
) |
Parameters
- surfaceName
- Type: System..::..String
The name of the new TinVolumeSurface.
- baseSurfaceId
- Type: ObjectId
The ObjectId of the base surface for the TinVolumeSurface.
- comparisonSurfaceId
- Type: ObjectId
The ObjectId of the comparison (top) surface for the TinVolumeSurface.
Remarks
Examples
CopyC#
1
2
3
4[CommandMethod("CreateTinVolumeSurface")]
5public void CreateTinVolumeSurface()
6{
7 using (Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
8 {
9 string surfaceName = "ExampleVolumeSurface";
10
11
12 ObjectId baseId = promptForTinSurface("Select the base surface");
13 ObjectId comparisonId = promptForTinSurface("Select the comparison surface");
14
15 try
16 {
17
18 ObjectId surfaceId = TinVolumeSurface.Create(surfaceName, baseId, comparisonId);
19 TinVolumeSurface surface = surfaceId.GetObject(OpenMode.ForWrite) as TinVolumeSurface;
20 }
21
22 catch (System.Exception e)
23 {
24 editor.WriteMessage("Surface create failed: {0}", e.Message);
25 }
26
27
28 ts.Commit();
29 }
30}
Exceptions
Exception | Condition |
---|
System..::..ArgumentException |
Thrown when:
- The surfaceName is empty.
- The baseSurfaceId is invalid or its type is not Autodesk.AutoCAD.DatabaseServices.Surface.
- The comparisonSurfaceId is invalid or its type is not Autodesk.AutoCAD.DatabaseServices.Surface.
|
See Also