Creates a new instance of a TinVolumeSurface and adds it to the database where the surface specified by baseSurfaceId is located.
public static ObjectId Create( string surfaceName, ObjectId baseSurfaceId, ObjectId comparisonSurfaceId )
Public Shared Function Create ( surfaceName As String, baseSurfaceId As ObjectId, comparisonSurfaceId As ObjectId ) As ObjectId
public: static ObjectId Create( String^ surfaceName, ObjectId baseSurfaceId, ObjectId comparisonSurfaceId )
| Exception | Condition |
|---|---|
| ArgumentException |
Thrown when:
|
1/// <summary> 2/// Creates a TIN volume surface from two existing TIN surfaces 3/// </summary> 4[CommandMethod("CreateTinVolumeSurface")] 5public void CreateTinVolumeSurface() 6{ 7 using (Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction()) 8 { 9 string surfaceName = "ExampleVolumeSurface"; 10 // Prompt user to select surfaces to use 11 // promptForTinSurface uses Editor.GetEntity() to select a TIN surface 12 ObjectId baseId = promptForTinSurface("Select the base surface"); 13 ObjectId comparisonId = promptForTinSurface("Select the comparison surface"); 14 15 try 16 { 17 // Create the surface 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 // commit the create action 28 ts.Commit(); 29 } 30}