大家好,有几个问题。
1) 我发到正确的论坛了吗?有没有。网络论坛在这里?如果是这样,请随时告诉我。
2) 我想将特定布局选项卡中的特定视口设置为“活动空间”,我正在用VB编写这篇文章。网我已经用VBA完成了这项工作,但是。网是一个更复杂的蜡球,我目前正在学习。实际上,我已经能够“获取”我想要的视口,但找不到类/方法/属性以使其成为“活动空间”?有什么提示吗?
- '*************************************** find viewport and activate **************************************
- Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
- Dim db As Database = HostApplicationServices.WorkingDatabase
- Try
- Dim layoutManager__1 As LayoutManager = LayoutManager.Current
- layoutManager__1.CurrentLayout = "Floor Plan 100"
- Dim vpXdim As String = ("18") 'viewport desired's CenterPoint X value
- Dim layout As Layout = TryCast(myTrans.GetObject(layoutManager__1.GetLayoutId _
- ("Floor Plan 100"), OpenMode.ForRead), Layout)
- Dim objectIdCollection As ObjectIdCollection = layout.GetViewports()
- For Each VportObjId As ObjectId In objectIdCollection
- Dim Vport As Viewport = DirectCast(myTrans.GetObject(VportObjId, OpenMode.ForWrite), Viewport)
- Dim X As String = Vport.CenterPoint.X.ToString
- If vpXdim = X Then 'center points are the same > this is desired viewport
- MsgBox("this is the viewport we want.....")
- 'Vport As AutoDesk.AutoCAD.DataBaseServices.Viewport
- 'Public Property ActiveViewport()As AutoDesk.AutoCAD.Interop.AcadViewport
- Exit For
- End If
- Next
- Catch ex As System.Exception
- ed.WriteMessage(vbLf & ex.Message)
- ed.WriteMessage(vbLf & ex.StackTrace)
- End Try
- '*********************************************************************************************************
已经尝试了AutoDesk讨论组和AUGI,在谷歌上到处都没有真正的运气。思想?
谢谢
特伦特 |