Thought that while I was here, might as well share a little sumfin sumfin I had to build for a program I'm working on.
Took a hell of a long time to find any info on this that was useable, so thought it might be useful for someone else too.
So, ya want to set a layer key override in ADT? (If you have to ask what a layer key override is, you don't want to know, trust me.)
Here's a little sub I wrote for setting it.
Sub SetLayerKeyOverride(LayerStateToUse As String)
Dim app As New AecBaseApplication
Dim doc As AecBaseDocument
Dim dbPref As AecBaseDatabasePreferences
Dim cLayerKeyStyles As AecLayerKeyStyles
Dim layerKeyStyle As AecLayerKeyStyle
app.Init ThisDrawing.Application
Set doc = app.ActiveDocument
Set cLayerKeyStyles = doc.LayerKeyStyles
Set dbPref = doc.Preferences
Set layerKeyStyle = cLayerKeyStyles.Item(dbPref.LayerStandard)
layerKeyStyle.OverrideSettings.Item(0).Value = LayerStateToUse
layerKeyStyle.OverrideSettings.Item(5).Value = " "
End Sub
Then just call it within another routine by using
Call SetLayerKeyOverride("Name of layer key override you want")
Like I said, just a little helper I was unable to find anything on in my own searching.
You need to add in references to the AEC Base 4.0 Application Library, and the AEC Base 4.0 Object Library to your project for this to work.