CanonicalMediaName Property (ActiveX)

Specifies the paper size by name.

Supported platforms: Windows only

Signature

VBA:

object.CanonicalMediaName
object

Type: Layout, PlotConfiguration

The objects this property applies to.

Property Value

Read-only: No

Type: String

The name of the paper size.

Remarks

Changes to this property will not be visible until after a regeneration of the drawing. Use the Regen method to regenerate the drawing.

Examples

VBA:

Sub Example_CanonicalMediaName()
    ' This example finds the name of the media for the active layout
    
    Dim MediaName As String
    MediaName = ThisDrawing.ActiveLayout.CanonicalMediaName
    
    If MediaName = "" Then
        MsgBox "There is no media set for the active layout."
    Else
        MsgBox "The media for the active layout is: " & MediaName
    End If
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_CanonicalMediaName()
    ;; This example finds the name of the media for the active layout
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    (setq MediaName (vla-get-CanonicalMediaName (vla-get-ActiveLayout doc)))
    
    (if (/= MediaName "")
        (alert "There is no media set for the active layout.")
        (alert (strcat "The media for the active layout is: " MediaName))
    )
)