Public objDbx As AxDbDocument Private Sub Class_Initialize() If Left(AcadApp.Version, 2) = "15" Then Set objDbx = GetInterfaceObject("ObjectDBX.AxDbDocument.1") ElseIf Left(AcadApp.Version, 2) = "16" Then Set objDbx = GetInterfaceObject("ObjectDBX.AxDbDocument.16") ElseIf Left(AcadApp.Version, 2) = "17" Then Set objDbx = GetInterfaceObject("ObjectDBX.AxDbDocument.17") End If End Sub
Private Sub Class_Initialize() If Left(AcadApp.Version, 2) = "15" Then Set objDbx = GetInterfaceObject("ObjectDBX.AxDbDocument.1") ElseIf Left(AcadApp.Version, 2) = "16" Then Set objDbx = GetInterfaceObject("ObjectDBX.AxDbDocument.16") ElseIf Left(AcadApp.Version, 2) = "17" Then Set objDbx = GetInterfaceObject("ObjectDBX.AxDbDocument.17") End If End Sub