CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

GetPaperSize Method (ActiveX)

2023-1-4 07:17| 发布者: admin| 查看: 590| 评论: 0|来自: AutoCAD

摘要: 获取已配置纸张的宽度和高度。

获取已配置纸张的宽度和高度。

支持的平台:仅窗口

签名

工 务 局:

object.GetPaperSize Width, Height
对象

类型:布局绘图配置

此方法适用的对象。

宽度

访问:仅输出

类型:

纸张的宽度。

高度

访问:仅输出

类型:

纸张的高度。

返回值(RetVal)

无返回值。

言论

宽度和高度值的单位由属性指定。PaperUnits

若要设置纸张大小,请使用该属性。CanonicalMediaName

例子

工 务 局:

Sub Example_GetPaperSize()
    ' This example gets the width and height of the default
    ' paper size for your system.
    
    Dim PaperWidth As Double
    Dim PaperHeight As Double
    
    ThisDrawing.ActiveLayout.GetPaperSize PaperWidth, PaperHeight
    
    MsgBox "The default paper size is " & vbCrLf & _
           "Width: " & PaperWidth & vbCrLf & _
           "Height: " & PaperHeight

End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_GetPaperSize()
    ;; This example gets the width and height of the default
    ;; paper size for your system.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    (vla-GetPaperSize (vla-get-ActiveLayout doc) 'PaperWidth 'PaperHeight)
    
    (alert (strcat "The default paper size is "
                   "\nWidth: " (rtos PaperWidth 2)
                   "\nHeight: " (rtos PaperHeight 2)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-11 15:04

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部