We have code, seen below, that pulls the Revision of the Drawing. Since there is no object that actually represents the drawing we are pulling the value from a specific sheet. Since users have complete control of the Sheet names we are forced to check for "Sheet1" then since AutoCAD has a similar situation we search for "SH1" next and if neither exist we just grab the next config, ie sheet, from the end.
We had a situation where a user renamed the sheets later in the drawing lifecycle. The current version is 85 and does not contain "Sheet1" but a much older version does contain "Sheet1"
What this has brought to light is that the GetVar, since we are specifically looking for Sheet1 config will seek out that config in the "newest available". How do we force GetVar to only pull from the current, or latest, version of the drawing? In our problem case it should have found nothing for "Sheet1" because that does not exist any longer.
Public Function ParGetProperty(ByVal configNames As String(), ByVal propertyName As String, ByRef value As Object, ByRef exception As ProcessException, Optional ByVal preferredConfigs As String() = Nothing) As Boolean
value = Nothing
exception = Nothing
Dim properties As IEdmEnumeratorVariable5 = m_File.GetEnumeratorVariable()
If preferredConfigs IsNot Nothing Then '<-- preferredConfigs is a string array with 2 values: "Sheet1" and "SH1"
For Each configName As String In preferredConfigs
If properties.GetVar(propertyName, configName, value) Then '<-- property name in this case is "Revision". This is the problem line!!
For Each configName As String In configNames
If properties.GetVar(propertyName, configName, value) Then
Catch pe As ProcessException
exception = pe
Catch ex As Exception
exception = New ProcessException(ex)