Tipo166 Posted April 21, 2009 Posted April 21, 2009 Hello All, couple questions. 1) Am I posting to the correct forum? Is there a .Net forum here? If so, please feel free to point me there. 2) I want to make a specific viewport in a specific layout tab the "active space" and I am writing this in VB.Net. I have done this with VBA but .Net is is a much more complicated ball of wax which I am currently learning. I have been able to actually "get" the viewport I want but can not find the class/method/property to make it the "active space"? Any pointers? '*************************************** 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 '********************************************************************************************************* Have tried AutoDesk discussion group and AUGI and all over google with no real luck. Thoughts? Thanks, Trent Quote
borgunit Posted April 22, 2009 Posted April 22, 2009 You might try here... http://through-the-interface.typepad.com/through_the_interface/ Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.