PaperUnits 属性 (ActiveX)
指定用于显示布局或打印配置属性的单位。 支持的平台:仅限 Windows 属性值只读:不 类型:枚举acPlotPaperUnits
言论此属性确定在用户界面中显示布局或打印配置的单位。此属性不确定 ActiveX 自动化属性的输入或查询的单位。所有 ActiveX 自动化属性都以毫米或弧度表示,无论单位设置如何。 在重新生成图形之前,对此属性的更改将不可见。使用该方法重新生成图形。Regen 例子VBA: Sub Example_PaperUnits()
' This example will access the Layouts collection for the current drawing
' and list basic information about the paper units used for each Layout.
Dim Layouts As AcadLayouts, Layout As ACADLayout
Dim msg As String
Dim Measurement As String
' Get layouts collection from document object
Set Layouts = ThisDrawing.Layouts
msg = vbCrLf ' Start with a space
' Get the paper units information of every layout in this drawing
For Each Layout In Layouts
' Using inches or millimeters?
Measurement = IIf(Layout.PaperUnits = acInches, " inches", " millimeters")
' Format for display
msg = msg & Layout.name & " is using" & Measurement & vbCrLf
Next
' Display paper units information
MsgBox "The paper units used in the current drawing are: " & msg
End Sub
可视化 LISP: (vl-load-com)
(defun c:Example_PaperUnits()
;; This example will access the Layouts collection for the current drawing
;; and list basic information about the paper units used for each Layout.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Get layouts collection from document object
(setq Layouts (vla-get-Layouts doc))
(setq msg ""
Measurement "")
;; Get the paper units information of every layout in this drawing
(vlax-for Layout Layouts
;; Using inches or millimeters?
(setq Measurement (if (= (vla-get-PaperUnits Layout) acInches) " inches" " millimeters"))
;; Format for display
(setq msg (strcat msg (vla-get-Name Layout) " is using" Measurement "\n"))
)
;; Display paper units information
(alert (strcat "The paper units used in the current drawing are: \n" msg))
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-28 07:00
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.