ConvertToCurrentVolumeDisplay Example

AEC Auto

ConvertToCurrentVolumeDisplay Example

Sub Example_ConvertToCurrentVolumeDisplay()
    
    ' This example returns the value of ConvertToCurrentVolumeDisplay
    ' for the current drawing.
    Dim dbPref As AecArchBaseDatabasePreferences
    Set dbPref = AecArchBaseApplication.ActiveDocument.preferences
    
    ' Set the volume display units to cubic yards
    dbPref.VolumeDisplayUnit = aecUnitCubicYard
    
    Dim SourceArea As Double
    Dim TargetArea As Double
    
    SourceArea = 36# * 36# *  36#       'Cubic inches
    TargetArea = dbPref.ConvertToCurrentVolumeDisplay(SourceArea)
    
    MsgBox "The area to convert is " & SourceArea & " cubic inches." & vbCrLf & _
        "The VolumeDisplayUnit is set to cubic yard." & vbCrLf & _
        "The value for ConvertToCurrentVolumeDisplay is " & TargetArea & " " & dbpref.VolumeSuffix, _
        vbInformation, "ConvertToCurrentVolumeDisplay Example"
    
End Sub