Share
 
 

PlotPolicy Property (ActiveX)

Determines whether an object's color property is associated with its plot style name when a new drawing is created.

Supported platforms: Windows only

Signature

VBA:

object.PlotPolicy
object

Type: PreferencesOutput

The object this property applies to.

Property Value

Read-only: No

Type: acPlotPolicy enum

  • acPolicyLegacy: Specifies color-dependent plot styles in both new drawings and drawings created in earlier versions of AutoCAD. Color-dependent plot styles use the numbers from the AutoCAD color index to create a plot style table with a .ctb file extension. Each color is defined by a name or number ranging from 1 to 255. You can assign each color number to a different pen on a pen plotter to achieve different property settings in the plotted drawing. If this option is entered, a plot style is created for each color setting.
  • acPolicyNamed: Specifies named plot styles in both new drawings and drawings created in earlier versions of AutoCAD. AutoCAD plots the drawing according to the property settings you specify in the plot style definition. The plot style is defined in the plot style table attached to the layout or viewport. Named plot style tables are files with the file extension .stb.

Remarks

The initial value for this property is acPolicyNamed.

If you want to change the default plot style behavior for a drawing, enter either acPolicyLegacy or acPolicyNamed before opening or creating the drawing. Changing the default plot style behavior using this property only affects new drawings or drawings created in a previous release of AutoCAD that have never been saved in AutoCAD 2000 or later format. This setting is saved with the drawing. You can change the default behavior for a drawing from acPolicyLegacy to acPolicyNamed once it is saved by using a migration utility. However, once a drawing is saved with acPolicyNamed as the default behavior, you cannot change it to acPolicyLegacy.

Examples

VBA:

Sub Example_PlotPolicy()
    ' This example reads and modifies the PlotPolicy
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.
    
    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Integer
    
    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.Preferences.Output
    
    ' Read and display the original value
    originalValue = ACADPref.PlotPolicy
    MsgBox "The PlotPolicy preference is set to: " & originalValue

    ' Modify the PlotPolicy preference by toggling the value
    ACADPref.PlotPolicy = acPolicyNamed
    MsgBox "The PlotPolicy preference has been set to: " & ACADPref.PlotPolicy

    ' Reset the preference back to its original value
    ACADPref.PlotPolicy = originalValue
    MsgBox "The PlotPolicy preference was reset back to: " & originalValue
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_PlotPolicy()
    ;; This example reads and modifies the PlotPolicy
    ;; preference value.
    ;; When finished, this example resets the preference value back to
    ;; its original value.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-PlotPolicy (vla-get-Output preferences)))
    (alert (strcat "The PlotPolicy preference is set to: " (itoa originalValue)))

    ;; Modify the PlotPolicy preference by toggling the value
    (vla-put-PlotPolicy (vla-get-Output preferences) acPolicyNamed)
    (alert (strcat "The PlotPolicy preference has been set to: " (itoa (vla-get-PlotPolicy (vla-get-Output preferences)))))

    ;; Reset the preference back to its original value
    (vla-put-PlotPolicy (vla-get-Output preferences) originalValue)
    (alert (strcat "The PlotPolicy preference was reset back to: " (itoa originalValue)))
)

Was this information helpful?