乐筑天下

帖子
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 31|回复: 1

Help me!怎样使用setcoustomscale方法

[复制链接]

5

主题

7

帖子

2

银币

初来乍到

Rank: 1

铜币
27
发表于 2004-12-17 14:01:00 | 显示全部楼层 |阅读模式
怎样使用setcoustomscale方法,望高手赐教
回复

使用道具 举报

25

主题

134

帖子

6

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
234
发表于 2004-12-17 14:32:00 | 显示全部楼层
语法
object.SetCustomScale(Numerator, Denominator)
Object
,
使用该方法的对象。
Numerator
Double[双精度]; 仅用于输入
用正数表示的比率中的分子。该值表示比例的英寸或毫米数。
Denominator
Double[双精度]; 仅用于输入
用正数表示的比率中的分母。该值表示比例的图形单位数。
说明
Numerator 参数的单位可在  属性中查到。
Numerator 和 Denominator 值必须大于 0。
该方法的产生的改动在图形重生成时不会显示。使用  方法重生成图形。
Sub Example_SetCustomScale()
                         ' This example will access the Layouts collection for the current drawing
                         ' and list basic information about the custom scale for each Layout.
                         ' It will then change the custom scale information for model space and re-display
                         ' the scale information.
                         Dim Layouts As AcadLayouts, Layout As ACADLayout
                         Dim msg As String
                         Dim Numerator As Double, Denominator As Double
                         Dim Measurement As String
                         
                         ' Display current scale information
                         GoSub DISPLAY_SCALE_INFO
                         
                         ' Modify scale
                         Numerator = 1
                         Denominator = 1
                         
                         ThisDrawing.Layouts("Model").SetCustomScale Numerator, Denominator
                         ThisDrawing.Regen acAllViewports
                                                                                         
                         ' Display new scale information
                         GoSub DISPLAY_SCALE_INFO
                                                         
                         Exit Sub
                         
DISPLAY_SCALE_INFO:
    ' Get layouts collection from document object
    Set Layouts = ThisDrawing.Layouts
   
    msg = vbCrLf & vbCrLf   ' Start with a space
   
    ' Get the scale information of every layout in this drawing
    For Each Layout In Layouts
        msg = msg & Layout.name & vbCrLf
        
        ' Get scale information
        Layout.GetCustomScale Numerator, Denominator
        
        ' Identify whether inches or millimeters are being used.
        Measurement = IIf(Layout.PaperUnits = acInches, " inch(es)", " millimeter(s)")
        
        ' Format for display
        msg = msg & vbTab & "Contains " & Numerator & Measurement & vbCrLf
        msg = msg & vbTab & "Contains " & Denominator & " drawing units" & vbCrLf
        msg = msg & "_____________________" & vbCrLf
        
    Next
   
    ' Display custom scale information
    MsgBox "Custom scale information for the current drawing is: " & msg
   
    Return
End Sub
回复

举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁體中文

GMT+8, 2025-3-17 05:31 , Processed in 1.172186 second(s), 67 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表