Keys Example

AEC Auto

Keys Example

Sub Example_Keys()

'This example shows the how to get the layer key from the layer key style.
 

    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

< PRE class= Code >
End Sub