Try this ..
Open an empty drawing.
Activate the "Model Space" tab
Create a line from 0,0 to 34,22
Create a plot setting using the ends of the line (0,0 34,22)
Name the plot setting "Temp"
Save the drawing
Run this code
Public Sub Test()
Dim oAcadDB As Database = Application.DocumentManager.MdiActiveDocument.Database
Dim oAcadTM As DBTransMan = oAcadDB.TransactionManager
Dim oAcadTR As Transaction = oAcadTM.StartTransaction()
Dim oAcadPSDictID As ObjectId = oAcadDB.PlotSettingsDictionaryId
Dim oAcadPSdict As DBDictionary
Dim oPSVal As PlotSettingsValidator = PlotSettingsValidator.Current
oAcadPSdict = CType(oAcadTR.GetObject(oAcadPSDictID, OpenMode.ForRead, False, False), DBDictionary)
Dim oDictEntry As DictionaryEntry
Dim PSExist As Boolean
Dim PSObjectID As ObjectId
Dim PSisLayout As Boolean
For Each oDictEntry In oAcadPSdict
If oDictEntry.Key = "Test" Then
PSExist = True
PSObjectID = oDictEntry.Value
Exit For
End If
Next
Dim PSPlotSettings As Autodesk.AutoCAD.DatabaseServices.PlotSettings
If PSExist Then
PSPlotSettings = CType(oAcadTR.GetObject(PSObjectID, OpenMode.ForRead, False, False), PlotSettings)
Dim strTemp As String
Dim oExtents2d As Autodesk.AutoCAD.DatabaseServices.Extents2d = PSPlotSettings.PlotWindowArea
strTemp = "X1 = " & CStr(oExtents2d.MinPoint.X) & " Y1 = " & CStr(oExtents2d.MinPoint.Y)
strTemp = strTemp & " X2 = " & CStr(oExtents2d.MaxPoint.X) & " Y2 = " & CStr(oExtents2d.MaxPoint.Y)
MsgBox(strTemp)
oAcadTR.Commit()
End If
If Not Nothing Then oAcadPSdict = Nothing
If Not Nothing Then oAcadPSDictID = Nothing
oPSVal.Dispose()
If Not Nothing Then oPSVal = Nothing
oAcadTR.Dispose()
oAcadTM.Dispose()
If Not Nothing Then oAcadDB = Nothing
If Not Nothing Then oAcadTM = Nothing
If Not Nothing Then oAcadTR = Nothing
End Sub
::::::::::::::::::::::::::::::::::::::::::::::::\
Note that the coordinates returned have an amibiguis relationship with the (0,0 34,22) coordinates that were manually used to define the plot setting.
Am I missing something, or is this a bug?