CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

PaperUnits Property (ActiveX)

2023-1-3 09:17| 发布者: admin| 查看: 439| 评论: 0|来自: AutoCAD

摘要: 指定用于显示布局或打印配置属性的单位。

指定用于显示布局或打印配置属性的单位。

支持的平台:仅窗口

签名

工 务 局:

object.PaperUnits
对象

类型:布局绘图配置

此属性适用的对象。

属性值

只读:

类型:枚举acPlotPaperUnits

  • acInches
  • acMillimeters
  • acPixels

言论

此属性确定在用户界面中显示布局或打印配置的单位。此属性不确定 ActiveX 自动化属性的输入或查询单位。所有 ActiveX 自动化属性都以毫米或弧度表示,而不考虑单位设置。

在重新生成图形之前,对此属性的更改将不可见。使用该方法再生图形。Regen

例子

工 务 局:

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

Visual 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))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-12 02:03

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部