LowerLeftCorner Property (ActiveX)

Gets the lower-left corner of the current active viewport.

Supported platforms: Windows only

Signature

VBA:

object.LowerLeftCorner
object

Type: Viewport

The object this property applies to.

Property Value

Read-only: Yes

Type: Variant (two-element array of doubles)

A 2D coordinate representing the lower-left corner of the current active viewport.

Remarks

The LowerLeftCorner and UpperRightCorner properties represent the graphic placement of the viewport on the display. These properties are defined as follows:



Viewport 1—LowerLeftCorner = (0, .5), UpperRightCorner = (.5, 1)

Viewport 2—LowerLeftCorner = (.5, .5), UpperRightCorner = (1, 1)

Viewport 3—LowerLeftCorner = (0, 0), UpperRightCorner = (.5, .5)

Viewport 4—LowerLeftCorner = (.5, 0), UpperRightCorner = (1, .5)

Examples

VBA:

Sub Example_LowerLeftCorner()
    ' This example creates a new viewport and makes it active.
    ' Then it splits the viewport into four windows.
    ' It then finds the lower-left 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 four 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 lower left corner.
    Dim entry As AcadViewport
    Dim lowerLeft As Variant
    For Each entry In ThisDrawing.Viewports
        entry.GridOn = True
        ThisDrawing.ActiveViewport = entry
        lowerLeft = entry.LowerLeftCorner
        MsgBox "The lower left corner of this viewport is " & lowerLeft(0) & ", " & lowerLeft(1), , "LowerLeftCorner Example"
        entry.GridOn = False
    Next
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_LowerLeftCorner()
    ;; This example creates a new viewport and makes it active.
    ;; Then it splits the viewport into four windows.
    ;; It then finds the lower-left corner of each of the
    ;; windows.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
       
    ;; Create a new viewport and make it active
    (setq newViewport (vla-Add (vla-get-Viewports doc) "TESTVIEWPORT"))
    (vla-put-ActiveViewport doc newViewport)
    
    ;; Split the viewport in four windows
    (vla-Split newViewport acViewport4)
    
    ;; Make the newly split viewport active
    (vla-put-ActiveViewport doc newViewport)
    
    ;; Iterate through the viewports. For each viewport,
    ;; make that viewport active and display the coordinates
    ;; of the lower left corner.
    (vlax-for entry (vla-get-Viewports doc)
        (vla-put-GridOn entry :vlax-true)
        (vla-put-ActiveViewport doc entry)
        (setq lowerLeft (vlax-safearray->list (vlax-variant-value (vla-get-LowerLeftCorner entry))))
        (alert (strcat "The lower left corner of this viewport is " (rtos (nth 0 lowerLeft) 2) ", " (rtos (nth 1 lowerLeft) 2)))
        (vla-put-GridOn entry :vlax-false)
    )
)