这个NET API自AutoCAD 2005(配置文件中列出的版本)以来发生了很大变化。因此,下面显示的示例可能不起作用。
导入Autodesk。AutoCAD。运行时
导入Autodesk。AutoCAD。数据库服务
导入Autodesk。AutoCAD。编辑输入
导入Autodesk。AutoCAD。几何学
导入Autodesk。AutoCAD。应用程序服务
- <CommandMethod("IV")> _
- Public Sub IsoView()
- Dim Doc As Document = Application.DocumentManager.MdiActiveDocument
- Dim db As Database = HostApplicationServices.WorkingDatabase
- If (db.TileMode = True) Then
- Using tran As Transaction = db.TransactionManager.StartTransaction()
- Dim vpr As ViewportTableRecord = DirectCast(tran.GetObject(db.CurrentViewportTableRecordId, OpenMode.ForWrite), ViewportTableRecord)
- If vpr IsNot Nothing Then
- Dim v3d As Vector3d = New Vector3d(1.0, -1.0, 1.0)
- vpr.ViewDirection = v3d
- End If
- tran.Commit()
- End Using
- Doc.Editor.UpdateTiledViewportsFromDatabase()
- End If
- End Sub
|