Volume Example
Sub Example_Volume () 'This example shows the volume of a mass element or mass group. Dim object As Object Dim pt As Variant Dim mass As AecMassElement Dim massGroup As AecMassGroup Dim count As Integer ThisDrawing.Utility.GetEntity object, pt, "Select Mass Element or Mass Group" If TypeOf object Is AecMassGroup Then Set massGroup = object MsgBox "Mass Group volume = " & Format(massGroup.Volume, "###0.000"), vbInformation, "Volume Example" Else If TypeOf object Is AecMassElement Then Set mass = object MsgBox "Mass Element volume = " & Format(mass.Volume, "###0.000"), vbInformation, "Volume Example" Else MsgBox "Mass Element or Group not selected.", vbInformation, "Volume Example" End If End If
End Sub