ConvertToCurrentAreaDisplay Example

Land Auto

ConvertToCurrentAreaDisplay Example

Sub Example_ConvertToCurrentAreaDisplay()
    
    ' This example returns the value of ConvertToCurrentAreaDisplay
    ' for the current drawing.
    Dim dbPref As AeccDatabasePreferences
    Set dbPref = AeccApplication.ActiveDocument.preferences
    
    ' Set the area display units to square yards
    dbPref.AreaDisplayUnit = aecUnitSquareYard
    
    Dim SourceArea As Double
    Dim TargetArea As Double
    
    SourceArea = 36# 'Square feet, assumes drawing set to foot units
    TargetArea = dbPref.ConvertToCurrentAreaDisplay(SourceArea)
    
    MsgBox "The area to convert is 36 square feet." & vbCrLf & _
        "The AreaDisplayUnit is set to square yard." & vbCrLf & _
        "The value for ConvertToCurrentAreaDisplay is " & TargetArea & " square yards.", _
        vbInformation, "ConvertToCurrentAreaDisplay Example"
    
End Sub