CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2019 开发者帮助

StandardScale2 属性 (ActiveX)

2024-5-18 17:53| 发布者: admin| 查看: 144| 评论: 0|原作者: admin|来自: AutoCAD

StandardScale2 属性 (ActiveX)

指定视口的标准比例。

支持的平台:仅限 Windows

签名

VBA:

object.StandardScale2
对象

类型: PViewport

此属性应用于的对象。

属性值

只读:

类型:

视口的标准比例值。

言论

没有其他评论。

例子

VBA:

Sub Example_StandardScale()
    ' This example will access the active layout for the current drawing
    ' and list the standard scale for that Layout.
    ' It then changes the standard scale for the layout, and finally
    ' resets the scale back to its original value.

    Dim Layout As ACADLayout
    Dim currScale As Integer
    
    ' Get the activeLayout
    Set Layout = ThisDrawing.ActiveLayout
    
    ' Find the current standard scale
    currScale = Layout.StandardScale
    MsgBox "The current standard scale is : " & Layout.StandardScale
    
    ' Change the standard scale to 100:1
    Layout.StandardScale = ac100_1
    MsgBox "The new standard scale is : " & Layout.StandardScale
    
    ' Reset the original standard scale
    Layout.StandardScale = currScale
    MsgBox "The new standard scale is : " & Layout.StandardScale
    
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_StandardScale()
    ;; This example will access the active layout for the current drawing
    ;; and list the standard scale for that Layout.
    ;; It then changes the standard scale for the layout, and finally
    ;; resets the scale back to its original value.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Get the activeLayout
    (setq Layout (vla-get-ActiveLayout doc))
    
    ;; Find the current standard scale
    (setq currScale (vla-get-StandardScale Layout))
    (alert (strcat "The current standard scale is : " (itoa currScale)))
    
    ;; Change the standard scale to 100:1
    (vla-put-StandardScale Layout ac100_1)
    (alert (strcat "The new standard scale is : " (itoa (vla-get-StandardScale Layout))))
    
    ;; Reset the original standard scale
    (vla-put-StandardScale Layout currScale)
    (alert (strcat "The new standard scale is : " (itoa (vla-get-StandardScale Layout))))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2025-3-14 07:47

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部