选择集应用一例
只选择Dimension的图元.Dim fType(0) As Integer, fData(0) As Variant
fType(0) = 0: fData(0) = "DIMENSION"
sSet.Select acSelectionSetAll, , , fType, fData
Sub ls()
Dim objDim As AcadDimension
Dim sSet As AcadSelectionSet
With ThisDrawing
On Error Resume Next
If Not IsNull(.SelectionSets.Item("MySetSelectionSet")) Then
Set sSet = .SelectionSets.Item("MySetSelectionSet")
CreateSelectionSet.Delete
End If
Set sSet = .SelectionSets.Add("MySetSelectionSet")
Dim fType(0) As Integer, fData(0) As Variant
fType(0) = 0: fData(0) = "DIMENSION"
sSet.Select acSelectionSetAll, , , fType, fData
End With
With sSet
For ii = 0 To .Count - 1
Set objDim = .Item(ii)
With objDim
.LinearScaleFactor = 10
.Layer = "尺寸线"
End With
Next ii
End With
End Sub
好例子 <p>这个例子很好,谢谢楼主。</p> <p>楼主能解释一下这段代码的功能吗</p> 明白了,找到标注对象,放到尺寸线层里去
页:
[1]