PlotHidden Example

Using Programming Languages other than VBA

Sub Example_PlotHidden()
	' This example will access the Layouts collection for the current drawing
	' and display whether the objects for each layout are to be hidden during a plot.
	' It will then toggle the state of PlotHidden for "Layout1" and re-display the
	' PlotHidden state for each Layout.

	Dim Layouts As AcadLayouts, Layout As ACADLayout
	Dim msg As String
	Dim IsHidden As String

	' Get layouts collection from document object
	Set Layouts = ThisDrawing.Layouts

	' Display current hidden information
	GoSub DISPLAY

	' Toggle object hidden state for Layout1
	Layouts("Layout1").PlotHidden = Not (Layouts("Layout1").PlotHidden)

	' Display new hidden information
	GoSub DISPLAY

	Exit Sub

DISPLAY:
	msg = ""	' Clear message

	' Determine whether the objects for each layout are hidden during a plot
	For Each Layout In Layouts
		' Are these objects hidden?
		IsHidden = IIf(Layout.PlotHidden, " are hidden ", " are not hidden ")
	
		' Format for display
		msg = msg & "Objects for " & Layout.name & IsHidden & "during a plot." & vbCrLf
	Next

	' Display layout information
	MsgBox msg

	Return
End Sub




   Comments?