CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2021 开发者帮助

StandardScale 属性 (ActiveX)

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

StandardScale 属性 (ActiveX)

指定布局、视口或打印配置的标准比例。

支持的平台:仅限 Windows

签名

VBA:

object.StandardScale
对象

类型:布局PlotConfigurationPViewport

此属性应用于的对象。

属性值

只读:

类型:枚举; 和对象,枚举; 对象acPlotScaleLayoutPlotConfigurationacViewportScalePViewport

    acPlotScale枚举

  • acScaleToFit:缩放以适应
  • ac1_128in_1ft: 1/128“= 1'
  • ac1_64in_1ft: 1/64“= 1'
  • ac1_32in_1ft: 1/32“= 1'
  • ac1_16in_1ft: 1/16“= 1'
  • ac3_32in_1ft: 3/32“= 1'
  • ac1_8in_1ft: 1/8“ = 1'
  • ac3_16in_1ft: 3/16“= 1'
  • ac1_4in_1ft: 1/4“ = 1'
  • ac3_8in_1ft: 3/8“ = 1'
  • ac1_2in_1ft: 1/2“ = 1'
  • ac3_4in_1ft: 3/4“ = 1'
  • ac1in_1ft: 1“= 1'
  • ac3in_1ft: 3“= 1'
  • ac6in_1ft: 6“= 1'
  • ac1ft_1ft: 1'= 1'
  • ac1_1: 1:1
  • ac1_2: 1:2
  • ac1_4: 1:4
  • ac1_8: 1:8
  • ac1_10: 1:10
  • ac1_16: 1:16
  • ac1_20: 1:20
  • ac1_30: 1:30
  • ac1_40: 1:40
  • ac1_50: 1:50
  • ac1_100: 1:100
  • ac2_1: 2:1
  • ac4_1: 4:1
  • ac8_1: 8:1
  • ac10_1: 10:1
  • ac100_1: 100:1

    acViewportScale枚举

  • acVpScaleToFit:缩放以适应
  • acVpCustomScale:习惯
  • acVp1_128in_1ft: 1/128“= 1'
  • acVp1_64in_1ft: 1/64“= 1'
  • acVp1_32in_1ft: 1/32“= 1'
  • acVp1_16in_1ft: 1/16“= 1'
  • acVp3_32in_1ft: 3/32“= 1'
  • acVp1_8in_1ft: 1/8“ = 1'
  • acVp3_16in_1ft: 3/16“= 1'
  • acVp1_4in_1ft: 1/4“ = 1'
  • acVp3_8in_1ft: 3/8“ = 1'
  • acVp1_2in_1ft: 1/2“ = 1'
  • acVp3_4in_1ft: 3/4“ = 1'
  • acVp1and1_2in_1ft: 1-1/2“= 1'
  • acVp3in_1ft: 3“= 1'
  • acVp6in_1ft: 6“= 1'
  • acVp1ft_1ft: 1'= 1'
  • acVp1_1: 1:1
  • acVp1_2: 1:2
  • acVp1_4: 1:4
  • acVp1_8: 1:8
  • acVp1_10: 1:10
  • acVp1_16: 1:16
  • acVp1_20: 1:20
  • acVp1_30: 1:30
  • acVp1_40: 1:40
  • acVp1_50: 1:50
  • acVp1_100: 1:100
  • acVp2_1: 2:1
  • acVp4_1: 4:1
  • acVp8_1: 8:1
  • acVp10_1: 10:1
  • acVp100_1: 100:1

言论

若要将视口设置为自定义比例,请将此属性设置为,然后使用该属性定义自定义比例值。acVpCustomScaleCustomScale

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

例子

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, 2024-12-15 12:41

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部