Index Example

AEC Auto

Index Example

Examples:

l AecLayerKey

l AecLayerOverrideSetting

l AecLayoutCurveNode

l AecLayoutGrid2DNode

l AecLayoutGrid2DXNode

l AecLayoutGrid2DYNode

l AecLayoutGrid3DNode

l AecLayoutGrid3DXNode

l AecLayoutGrid3DYNode

l AecLayoutGrid3DZNode

l AecRing

l AecViewBlock


Sub Example_Index_AecLayerKey()

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

    Dim db As New AecBaseDatabase
    Dim layerKey As AecLayerKey
    
    db.Init ThisDrawing.Database
    
    Set layerKey = db.LayerKeyStyles.Item(0).Keys.Item(0)
    MsgBox "Layer Index: " & layerKey.Index, vbInformation, "Index Example"

End Sub

Sub Example_Index_AecLayerOverrideSetting()

    'This example shows the index of the overridesetting

    Dim db As New AecBaseDatabase
    Dim setting As AecLayerOverrideSetting
    
    db.Init ThisDrawing.Database
    
    Set setting = db.LayerKeyStyles.Item(0).overrideSettings.Item(0)
    MsgBox "Setting Index: " & setting.Index, vbInformation, "Index Example"

End Sub

Sub Example_Index_AecLayoutCurveNode()

  'This example displays the color of the nodes owner layout curve
  
  Dim obj As Object
  Dim pt As Variant
  Dim layoutCurve As AecLayoutCurve
  Dim node As AecLayoutCurveNode
  
  ThisDrawing.Utility.GetEntity obj, pt, "Select a Layout Curve"
  
  If TypeOf obj Is AecLayoutCurve Then
      Set layoutCurve = obj
      Set node = layoutCurve.nodes.Item(0)
      MsgBox "Color is: " & node.layoutCurve.Color, vbInformation, "LayoutCurve Example"
  Else
      MsgBox "Not a Layout Curve", vbExclamation, "LayoutCurve Example"
  End If

End Sub

Sub Example_Index_AecLayoutGrid2DNode()

    'This example displays the index of a layout node
  
    Dim obj As Object
    Dim pt As Variant
    Dim grid As AecLayoutGrid2D
    Dim node As AecLayoutGrid2DNode
   
    ThisDrawing.Utility.GetEntity obj, pt, "Select a 2D Layout Grid"
  
    If TypeOf obj Is AecLayoutGrid2D Then
        Set grid = obj
        Set node = grid.XNodes.Item(0)
        MsgBox "Node Index is: " & node.Index, vbInformation, "Index Example"
    Else
        MsgBox "Not a 2D Layout Grid", vbExclamation, "Index Example"
    End If

End Sub

Sub Example_Index_AecLayoutGrid2DXNode()
    
    'This example displays the index of a layout Xnode
  
    Dim obj As Object
    Dim pt As Variant
    Dim grid As AecLayoutGrid2D
    Dim node As AecLayoutGrid2DNode
   
    ThisDrawing.Utility.GetEntity obj, pt, "Select a 2D Layout Grid"
  
    If TypeOf obj Is AecLayoutGrid2D Then
        Set grid = obj
        Set node = grid.XNodes.Item(0)
        MsgBox "XNode Index is: " & node.Index, vbInformation, "Index Example"
    Else
        MsgBox "Not a 2D Layout Grid", vbExclamation, "Index Example"
    End If

End Sub

Sub Example_Index_AecLayoutGrid2DYNode()
    
    'This example displays the index of a layout Ynode
  
    Dim obj As Object
    Dim pt As Variant
    Dim grid As AecLayoutGrid2D
    Dim node As AecLayoutGrid2DNode
   
    ThisDrawing.Utility.GetEntity obj, pt, "Select a 2D Layout Grid"
  
    If TypeOf obj Is AecLayoutGrid2D Then
        Set grid = obj
        Set node = grid.YNodes.Item(0)
        MsgBox "YNode Index is: " & node.Index, vbInformation, "Index Example"
    Else
        MsgBox "Not a 2D Layout Grid", vbExclamation, "Index Example"
    End If

End Sub

Sub Example_Index_AecLayoutGrid3DNode()
    
    'This example displays the index of a layout node
  
    Dim obj As Object
    Dim pt As Variant
    Dim grid As AecLayoutGrid3D
    Dim node As AecLayoutGrid3DNode
   
    ThisDrawing.Utility.GetEntity obj, pt, "Select a 3D Layout Grid"
  
    If TypeOf obj Is AecLayoutGrid3D Then
        Set grid = obj
        Set node = grid.XNodes.Item(0)
        MsgBox "Node Index is: " & node.Index, vbInformation, "Index Example"
    Else
        MsgBox "Not a 3D Layout Grid", vbExclamation, "Index Example"
    End If

End Sub

Sub Example_Index_AecLayoutGrid3DXNode()
    
    'This example displays the index of a layout Xnode
  
    Dim obj As Object
    Dim pt As Variant
    Dim grid As AecLayoutGrid3D
    Dim node As AecLayoutGrid3DNode
   
    ThisDrawing.Utility.GetEntity obj, pt, "Select a 3D Layout Grid"
  
    If TypeOf obj Is AecLayoutGrid3D Then
        Set grid = obj
        Set node = grid.XNodes.Item(0)
        MsgBox "XNode Index is: " & node.Index, vbInformation, "Index Example"
    Else
        MsgBox "Not a 3D Layout Grid", vbExclamation, "Index Example"
    End If

End Sub

Sub Example_Index_AecLayoutGrid3DYNode()
    
    'This example displays the index of a layout Ynode
  
    Dim obj As Object
    Dim pt As Variant
    Dim grid As AecLayoutGrid3D
    Dim node As AecLayoutGrid3DNode
   
    ThisDrawing.Utility.GetEntity obj, pt, "Select a 3D Layout Grid"
  
    If TypeOf obj Is AecLayoutGrid3D Then
        Set grid = obj
        Set node = grid.YNodes.Item(0)
        MsgBox "YNode Index is: " & node.Index, vbInformation, "Index Example"
    Else
        MsgBox "Not a 3D Layout Grid", vbExclamation, "Index Example"
    End If

End Sub

Sub Example_Index_AecLayoutGrid3DZNode()
    
    'This example displays the index of a layout Znode
  
    Dim obj As Object
    Dim pt As Variant
    Dim grid As AecLayoutGrid3D
    Dim node As AecLayoutGrid3DNode
   
    ThisDrawing.Utility.GetEntity obj, pt, "Select a 3D Layout Grid"
  
    If TypeOf obj Is AecLayoutGrid3D Then
        Set grid = obj
        Set node = grid.ZNodes.Item(0)
        MsgBox "ZNode Index is: " & node.Index, vbInformation, "Index Example"
    Else
        MsgBox "Not a 3D Layout Grid", vbExclamation, "Index Example"
    End If
  

End Sub

Sub Example_Index_AecRing()
    
    'This example will display the index of the ring
    
    Dim db As New AecBaseDatabase
    Dim ring As AecRing
    
    db.Init ThisDrawing.Database
    
    Set ring = db.ProfileStyles.Item(0).Profile.rings.Item(0)
    MsgBox "Ring Index: " & ring.Index, vbInformation, "Index Example"

End Sub

Sub Example_Index_AecViewBlock()
    
'This example shows the index 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 "Index of View Block 1: " & viewBlocks.Item(0).Index, vbInformation, "Index Example"
    Else
        MsgBox "Not a Multiview Block", vbInformation, "Index Example"
    End If

End Sub