Plottable 属性 (ActiveX)
指定图层是否可打印。 支持的平台:仅限 Windows 属性值只读:不 类型:布尔
言论没有其他评论。 例子VBA: Sub Example_Plottable()
' This example creates a new layer called "New_Layer". It then uses
' the Plottable property of each Layer to display whether or not that layer
' is plottable. The user has the ability to toggle the plottable state
' for each layer, and the final plottable status for all layers is displayed.
Dim layerObj As AcadLayer, tempLayer As AcadLayer
Dim msg As String
' Add the layer to the layers collection
Set layerObj = ThisDrawing.Layers.Add("New_Layer")
' Make the new layer the active layer for the drawing
ThisDrawing.ActiveLayer = layerObj
' Cycle through the layers and allow user to make them plottable or not
For Each tempLayer In ThisDrawing.Layers
If tempLayer.Plottable Then ' Determine if this layer is plottable
If MsgBox("The layer '" & tempLayer.name & "' will plot. Would you like to turn off plotting for this layer?", vbYesNo & vbQuestion) = vbYes Then
tempLayer.Plottable = False ' Change plottable state
End If
Else
If MsgBox("The layer '" & tempLayer.name & "' will not plot. Would you like to turn on plotting for this layer?", vbYesNo & vbQuestion) = vbYes Then
tempLayer.Plottable = True ' Change plottable state
End If
End If
Next
' Display the new plottable status of the layers in this drawing
For Each tempLayer In ThisDrawing.Layers
' Determine if this layer is plottable
If tempLayer.Plottable Then
msg = msg & "The layer '" & tempLayer.name & "' will plot." & vbCrLf
Else
msg = msg & "The layer '" & tempLayer.name & "' will not plot." & vbCrLf
End If
Next
MsgBox msg
End Sub
可视化 LISP: (vl-load-com)
(defun c:Example_Plottable()
;; This example creates a new layer called "New_Layer". It then uses
;; the Plottable property of each Layer to display whether or not that layer
;; is plottable. The user has the ability to toggle the plottable state
;; for each layer, and the final plottable status for all layers is displayed.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Add the layer to the layers collection
(setq layerObj (vla-Add (vla-get-Layers doc) "New_Layer"))
;; Make the new layer the active layer for the drawing
(vla-put-ActiveLayer doc layerObj)
;; Cycle through the layers and allow user to make them plottable or not
(vlax-for tempLayer (vla-get-Layers doc)
(if (= (vla-get-Plottable tempLayer) :vlax-true) ;; Determine if this layer is plottable
(progn
(alert (strcat "The layer '" (vla-get-Name tempLayer) "' set to plot."))
(vla-put-Plottable tempLayer :vlax-false) ;; Change plottable state
(alert (strcat "The layer '" (vla-get-Name tempLayer) "' now set not to plot."))
)
(progn
(alert (strcat "The layer '" (vla-get-Name tempLayer) "' set not to plot."))
(vla-put-Plottable tempLayer :vlax-true) ;; Change plottable state
(alert (strcat "The layer '" (vla-get-Name tempLayer) "' now set to plot."))
)
)
)
(setq msg "")
;; Display the new plottable status of the layers in this drawing
(vlax-for tempLayer (vla-get-Layers doc)
;; Determine if this layer is plottable
(if (= (vla-get-Plottable tempLayer) :vlax-true)
(setq msg (strcat msg "The layer '" (vla-get-Name tempLayer) "' will plot.\n"))
(setq msg (strcat msg "The layer '" (vla-get-Name tempLayer) "' will not plot.\n"))
)
)
(alert msg)
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-30 04:34
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.