Active Contributor
Chris Ludtke
Posts: 44
Registered: ‎04-12-2005
Message 1 of 2 (106 Views)

Window Coordinate (Extents) bug Plot Setting Window

106 Views, 1 Replies
07-18-2005 01:42 PM
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
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)
End If

If Not Nothing Then oAcadPSdict = Nothing
If Not Nothing Then oAcadPSDictID = Nothing
If Not Nothing Then oPSVal = Nothing
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?
Posts: 11
Registered: ‎01-05-2007
Message 2 of 2 (106 Views)

Re: Window Coordinate (Extents) bug Plot Setting Window

01-30-2007 05:18 PM in reply to: Chris Ludtke
Did you ever figure this one out? Currently having similar problem, don't know how to get extents exactly and having hard time setting new plotsettings current. Any help is appreciated.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community