Name Example

AEC Auto

Name Example

Examples:

l AecMassGroup

l AecCamera

l AecLayerKey

l AecViewBlock


Sub Example_Name_AecMassGroup()

'This example shows the name of the 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
            MsgBox "Mass Group " & count & " Name is: " & group.Name, vbInformation, "Name Example"
        End If
        
    Next
    
    If count = 0 Then
        MsgBox "No Mass Element Groups Present in Drawing", vbInformation, "Name Example"
    End If

End Sub

Sub Example_Name_AecCamera()

  'This example displays the name of a selected camera object
  
  Dim obj As Object
  Dim pt As Variant
  Dim camera As AecCamera
  
  ThisDrawing.Utility.GetEntity obj, pt, "Select a Camera"
  
  If TypeOf obj Is AecCamera Then
      Set camera = obj
      MsgBox "Name is: " & camera.Name, vbInformation, "Name Example"
  Else
      MsgBox "Not a Camera", vbExclamation, "Name Example"
  End If

End Sub

Sub Example_Name_AecLayerKey()

'This example shows the name of the layer generated by the key

    Dim doc As AecArchBaseDocument
    Dim dbPref As AecArchBaseDatabasePreferences
    Dim cLayerKeyStyles As AecLayerKeyStyles
    Dim layerKeyStyle As AecLayerKeyStyle
    Dim cLayerKeys As AecLayerKeys
    Dim layerKey As AecLayerKey
    
    Set doc = AecArchBaseApplication.ActiveDocument
    Set cLayerKeyStyles = doc.LayerKeyStyles
    Set dbPref = doc.Preferences
    ' Sets the layer key style to the current layer standard
    Set layerKeyStyle = cLayerKeyStyles.Item(dbPref.LayerStandard)
    Set cLayerKeys = layerKeyStyle.Keys
    
    For Each layerKey In cLayerKeys
        Debug.Print layerKey.Name
        Debug.Print " Color      - " & layerKey.Color
        Debug.Print " Layer      - " & layerKey.Layer
        Debug.Print " LineType   -  " & layerKey.Linetype
        Debug.Print " Lineweight - " & layerKey.Lineweight
        Debug.Print " Plotstyle  - " & layerKey.PlotStyleName
        Debug.Print " Plottable  -  " & layerKey.Plottable
        Debug.Print " Removable  -  " & layerKey.Removeable
    Next
End Sub

Sub Example_Name_AecViewBlock()

'This example shows the name of the first viewblock of a multiviewblock

    Dim obj As Object
    Dim pt As Variant
    Dim blockRef As AecMVBlockRef
    Dim viewBlocks As AecViewBlocks
    
    ThisDrawing.Utility.GetEntity obj, pt, "Select a Multiview Block"
    If TypeOf obj Is AecMVBlockRef Then
        Set blockRef = obj
        Set viewBlocks = blockRef.viewBlocks
        MsgBox "Name of View Block 1: " & viewBlocks.Item(0).Name, vbInformation, "Name Example"
    Else
        MsgBox "Not a Multiview Block", vbInformation, "Name Example"
    End If

End Sub