UCSPerViewport Property (ActiveX)

Specifies if the UCS is saved with the viewport.

Supported platforms: Windows only

Signature

VBA:

object.UCSPerViewport
object

Type: PViewport

The object this property applies to.

Property Value

Read-only: No

Type: Boolean

Remarks

No additional remarks.

Examples

VBA:

Sub Example_ViewportOn()
    ' This example creates two new paper space viewports.
    ' It then checks the status of the viewports.
    
    Dim pviewportObj1 As AcadPViewport
    Dim pviewportObj2 As AcadPViewport
    Dim center(0 To 2) As Double
    Dim width As Double
    Dim height As Double
    
    ' Define the paper space viewport
    center(0) = 3: center(1) = 3: center(2) = 0
    width = 10
    height = 10
    
    ' Change from model space to paper space
    ThisDrawing.ActiveSpace = acPaperSpace
    
    ' Create the paper space viewports
    Set pviewportObj1 = ThisDrawing.PaperSpace.AddPViewport(center, width, height)
    center(0) = 8: center(1) = 8: center(2) = 0
    width = 10
    height = 10
    Set pviewportObj2 = ThisDrawing.PaperSpace.AddPViewport(center, width, height)
    
    ' Before making a paper space viewport active,
    ' the mspace property needs to be True
    pviewportObj1.DISPLAY (True)
    ThisDrawing.mspace = True
    ThisDrawing.ActivePViewport = pviewportObj1
    ThisDrawing.Regen acAllViewports
    
    MsgBox "pviewportObj1 is " & (IIf(pviewportObj1.ViewportOn, "on.", "not on.")) & vbCrLf & _
           "pviewportObj2 is " & (IIf(pviewportObj2.ViewportOn, "on.", "not on."))
    
    ' Now turn on pviewportObj2 as well
    pviewportObj2.DISPLAY (True)
    MsgBox "pviewportObj1 is " & (IIf(pviewportObj1.ViewportOn, "on.", "not on.")) & vbCrLf & _
           "pviewportObj2 is " & (IIf(pviewportObj2.ViewportOn, "on.", "not on."))
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ViewportOn()
    ;; This example creates two new paper space viewports.
    ;; It then checks the status of the viewports.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define the paper space viewport
    (setq center (vlax-3d-point 3 3 0)
          width 10
          height 10)
    
    ;; Change from model space to paper space
    (vla-put-ActiveSpace doc acPaperSpace)
    
    ;; Create the paper space viewports
    (setq paperSpace (vla-get-PaperSpace doc))
    (setq pviewportObj1 (vla-AddPViewport paperSpace center width height))
  
    (setq center (vlax-3d-point 8 8 0)
          width 10
          height 10)

    (setq pviewportObj2 (vla-AddPViewport paperSpace center width height))
    
    ;; Before making a paper space viewport active,
    ;; the mspace property needs to be True
    (vla-Display pviewportObj1 :vlax-true)

    (vla-put-MSpace doc :vlax-true)
    (vla-put-ActivePViewport doc pviewportObj1)
    (vla-Regen doc acAllViewports)
    
    (alert (strcat "pviewportObj1 is " (if (= (vla-get-ViewportOn pviewportObj1) :vlax-true) "on." "not on.")
                   "\npviewportObj2 is " (if (= (vla-get-ViewportOn pviewportObj2) :vlax-true) "on." "not on.")))
    
    ;; Now turn on pviewportObj2 as well
    (vla-Display pviewportObj2 :vlax-true)

    (alert (strcat "pviewportObj1 is " (if (= (vla-get-ViewportOn pviewportObj1) :vlax-true) "on." "not on.")
                   "\npviewportObj2 is " (if (= (vla-get-ViewportOn pviewportObj2) :vlax-true) "on." "not on.")))
)