马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
问题:
Control the AutoCAD SCREENSIZE environment variable in AutoCAD using .NET
解答:
The SCREENSIZE system variable is a read-only system variable that stores the current viewport size in pixels.
However, we might feel the need some times to adjust the SCREENSIZE. For instance, so you you might want to export the model space to WMF format at a specific size and aspect ratio.
One easy way to change the SCREENSIZE is to just change the active document size:
- <CommandMethod("ChangeScreenSize")> _
- Public Sub changeScreenSize()
- Dim doc As Document = Application.DocumentManager.
- MdiActiveDocument
- Dim docWindow As Window = doc.Window
- Dim size As Size = docWindow.Size
- Dim ed As Editor = doc.Editor
- ed.WriteMessage(vbCrLf + "Document Size:" + vbCrLf +
- size.ToString() + vbCrLf)
- docWindow.WindowState = Window.State.Normal
- docWindow.Size = New Size(500, 500)
- End Sub
Please not that the document window size and the screen size are not exactly the same. the document window tends to be slightly bigger due to the additional non-editor parts of the drawing document window. So you will have to experiment with it a little bit to set it to the right screen size you need.
|