DifferenceGrid Example

Land Auto

DifferenceGrid Example

Sub Example_DifferenceGrid()
    
    ' This example creates a surface from two existing, overlapping,
    ' surfaces using the Grid method.
    Dim surfs As AeccSurfaces
    Dim diffSurf As AeccSurface
    Set surfs = AeccApplication.ActiveProject.Surfaces
    
    Dim surf0 As String
    Dim surf1 As String
    Dim surf2 As String
    Dim gridx As Double
    Dim gridy As Double
    Dim pnt As Variant
    Dim rows As Integer
    Dim columns As Integer
    
    ' Get the difference grid input
    surf0 = ThisDrawing.Utility.GetString(True, "Enter name for new Surface: ")
    surf1 = ThisDrawing.Utility.GetString(True, "Enter name of first Surface: ")
    surf2 = ThisDrawing.Utility.GetString(True, "Enter name of overlapping Surface: ")
    gridx = ThisDrawing.Utility.GetReal("Enter the width of the grid: ")
    gridy = ThisDrawing.Utility.GetReal("Enter the height of the grid: ")
    rows = ThisDrawing.Utility.GetInteger("Enter the number of rows in the grid: ")
    columns = ThisDrawing.Utility.GetInteger("Enter the number of columns in the grid: ")
    pnt = ThisDrawing.Utility.GetPoint(, "Select lower left point of grid: ")
    
    ' Create the difference grid
    diffSurf = surfs.DifferenceGrid(surf0, surf1, surf2, gridx, gridy, rows, columns, pnt(0), pnt(1), 0#)
    
    MsgBox "The number of faces in the new surface is: " & diffSurf.NumberOfFaces, _
        vbInformation, "DifferenceGrid Example"
    
End Sub