CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

StandardScale2 Property (ActiveX)

2023-1-3 05:48| 发布者: admin| 查看: 167| 评论: 0|来自: AutoCAD

摘要: 指定视区的标准比例。

指定视区的标准比例。

支持的平台:仅窗口

签名

工 务 局:

object.StandardScale2
对象

类型:光伏港

此属性适用的对象。

属性值

只读:

类型:

视区的标准比例值。

言论

没有额外的评论。

例子

工 务 局:

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

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

GMT+8, 2024-5-12 20:12

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部