UpperRightCorner Example |
Using Programming Languages other than VBA
Sub Example_UpperRightCorner() ' This example creates a new viewport and makes it active. ' Then it splits the viewport into 4 windows. ' It then takes finds the upper right corner of each of the ' windows. Dim newViewport As AcadViewport ' Create a new viewport and make it active Set newViewport = ThisDrawing.Viewports.Add("TESTVIEWPORT") ThisDrawing.ActiveViewport = newViewport ' Split the viewport in 4 windows newViewport.Split acViewport4 ' Make the newly split viewport active ThisDrawing.ActiveViewport = newViewport ' Iterate through the viewports. For each viewport, ' make that viewport active and display the coordinates ' of the upper right corner. Dim entry As AcadViewport Dim UpperRight As Variant For Each entry In ThisDrawing.Viewports entry.GridOn = True ThisDrawing.ActiveViewport = entry UpperRight = entry.UpperRightCorner MsgBox "The upper right corner of this viewport is " & UpperRight(0) & ", " & UpperRight(1), , "UpperRightCorner Example" entry.GridOn = False Next End Sub
Comments? |