Specifies the paper size by name.
Supported platforms: Windows only
VBA:
object.CanonicalMediaName
Type: Layout, PlotConfiguration
The objects this property applies to.
Read-only: No
Type: String
The name of the paper size.
Changes to this property will not be visible until after a regeneration of the drawing. Use the Regen method to regenerate the drawing.
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))
)
)