ShowPlotStyles Property (ActiveX)

Specifies whether or not plot styles and plot style names are displayed in the drawing.

Supported platforms: Windows only

Signature

VBA:

object.ShowPlotStyles
object

Type: Layout, PlotConfiguration

The objects this property applies to.

Property Value

Read-only: No

Type: Boolean

Remarks

The ShowPlotStyles property is equivalent to the Display Plot Styles option in AutoCAD.

Examples

VBA:

Sub Example_ShowPlotStyles()
    ' This example reads and modifies the ShowPlotStyles
    ' value, and then regenerates all viewports.
    
    Dim ACADLayout As ACADLayout
    Dim originalValue As Boolean
    
    ' Get the layout object
    Set ACADLayout = ThisDrawing.ActiveLayout
    
    ' Read and display the original value
    originalValue = ACADLayout.ShowPlotStyles
    MsgBox "The ShowPlotStyles value is set to: " & originalValue

    ' Modify the ShowPlotStyles preference by changing the value
    ACADLayout.ShowPlotStyles = Not ACADLayout.ShowPlotStyles
    MsgBox "The ShowPlotStyles value has been set to: " & ACADLayout.ShowPlotStyles

    ' Regenerate viewports
    ThisDrawing.Regen acAllViewports

End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ShowPlotStyles()
    ;; This example reads and modifies the ShowPlotStyles
    ;; value, and then regenerates all viewports.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Get the layout object
    (setq ACADLayout (vla-get-ActiveLayout doc))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-ShowPlotStyles ACADLayout))
    (alert (strcat "The ShowPlotStyles value is set to: " (if (= originalValue :vlax-true) "True" "False")))

    ;; Modify the ShowPlotStyles preference by changing the value
    (vla-put-ShowPlotStyles ACADLayout (if (= originalValue :vlax-true) :vlax-false :vlax-true))
    (alert (strcat "The ShowPlotStyles value has been set to: " (if (= (vla-get-ShowPlotStyles ACADLayout) :vlax-true) "True" "False")))

    ;; Regenerate viewports
    (vla-Regen doc acAllViewports)
)