选择集法修改尺寸线的标注比例和图层.
<p>主程序</p><p>Sub DimensionScale()<br/> Dim sSet As AcadSelectionSet<br/> Dim tempStr As String, fType, fData<br/> <br/> Set sSet = returnCornerAllSelects()<br/> Dim objDim As AcadDimension, objD As AcadDimRotated<br/> Dim Ent As AcadEntity<br/> For Each Ent In sSet<br/> If InStr(UCase(Ent.ObjectName), "DIMENSION") > 0 Then<br/> Set objDim = Ent<br/> With objDim<br/> .LinearScaleFactor = 10 '尺寸标注比例<br/> .Layer = "尺寸线"<br/> End With<br/> End If<br/> Next Ent<br/>End Sub</p><p>选择集程序</p><p>Function returnCornerAllSelects() As AcadSelectionSet<br/> Dim sSet As AcadSelectionSet</p><p> Dim Pt1 As Variant, Pt2 As Variant<br/> With ConnectCad.ActiveDocument<br/> On Error Resume Next<br/> Pt1 = .Utility.GetPoint(, "Select First Point")<br/> Pt2 = .Utility.GetCorner(Pt1, "Select Corner Point")<br/> Set sSet = .SelectionSets.Item(tempsSet)<br/> <br/> sSet.Delete<br/> tempsSet = "temp"<br/> Set sSet = .SelectionSets.Add(tempsSet)<br/> <br/> sSet.Select acSelectionSetCrossing, Pt1, Pt2<br/> End With<br/> Set returnCornerAllSelects = sSet<br/>End Function</p> 版主是在放代码啊
页:
[1]