Operation Example

AEC Auto

Operation Example

Examples:

l AecMassElement

l AecMassGroup


Sub Example_Operation_AecMassElement()

'This example shows the operation of a mass element?

    Dim object As Object
    Dim mass As AecMassElement
    Dim count As Integer
    
    'initalize
    count = 0
    
    For Each object In ThisDrawing.ModelSpace
    
        If TypeOf object Is AecMassElement Then
            count = count + 1
            Set mass = object
            
            Select Case mass.Operation
            Case aecMassOperationAdd
                MsgBox "Mass Element " & count & " Operation: Add", vbInformation, "Operation Example"
            Case aecMassOperationIntersect
                MsgBox "Mass Element " & count & " Operation: Intersect", vbInformation, "Operation Example"
            Case aecMassOperationSubtract
                MsgBox "Mass Element " & count & " Operation: Subtract", vbInformation, "Operation Example"
            End Select
            
        End If
        
    Next
    
    If count = 0 Then
        MsgBox "No Mass Elements Present in Drawing", vbInformation, "Operation Example"
    End If

End Sub

Sub Example_Operation_AecMassGroup()

'This example shows the operation of a mass group?

    Dim object As Object
    Dim group As AecMassGroup
    Dim count As Integer
    
    'initalize
    count = 0
    
    For Each object In ThisDrawing.ModelSpace
    
        If TypeOf object Is AecMassGroup Then
            count = count + 1
            Set group = object
            
            Select Case group.Operation
            Case aecMassOperationAdd
                MsgBox "Mass Group " & count & " Operation: Add", vbInformation, "Operation Example"
            Case aecMassOperationIntersect
                MsgBox "Mass Group " & count & " Operation: Intersect", vbInformation, "Operation Example"
            Case aecMassOperationSubtract
                MsgBox "Mass Group " & count & " Operation: Subtract", vbInformation, "Operation Example"
            End Select
            
        End If
        
    Next
    
    If count = 0 Then
        MsgBox "No Mass Element Groups Present in Drawing", vbInformation, "Operation Example"
    End If

End Sub