明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1692|回复: 1

选择集法修改尺寸线的标注比例和图层.

[复制链接]
发表于 2009-8-12 12:13:00 | 显示全部楼层 |阅读模式

主程序

Sub DimensionScale()
  Dim sSet As AcadSelectionSet
  Dim tempStr As String, fType, fData
 
  Set sSet = returnCornerAllSelects()
  Dim objDim As AcadDimension, objD As AcadDimRotated
  Dim Ent As AcadEntity
  For Each Ent In sSet
    If InStr(UCase(Ent.ObjectName), "DIMENSION") > 0 Then
      Set objDim = Ent
        With objDim
          .LinearScaleFactor = 10  '尺寸标注比例
          .Layer = "尺寸线"
        End With
     End If
  Next Ent
End Sub

选择集程序

Function returnCornerAllSelects() As AcadSelectionSet
  Dim sSet As AcadSelectionSet

  Dim Pt1 As Variant, Pt2 As Variant
  With ConnectCad.ActiveDocument
    On Error Resume Next
    Pt1 = .Utility.GetPoint(, "Select First Point")
    Pt2 = .Utility.GetCorner(Pt1, "Select Corner Point")
    Set sSet = .SelectionSets.Item(tempsSet)
   
    sSet.Delete
    tempsSet = "temp"
    Set sSet = .SelectionSets.Add(tempsSet)
   
    sSet.Select acSelectionSetCrossing, Pt1, Pt2
  End With
  Set returnCornerAllSelects = sSet
End Function

发表于 2009-8-14 09:54:00 | 显示全部楼层
版主是在放代码啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 02:50 , Processed in 0.193545 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表