兰州人 发表于 2009-3-9 11:46:00

选择集应用一例

只选择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

事后诸葛 发表于 2009-3-9 23:39:00

好例子

542392339 发表于 2010-1-6 17:32:00

zjh274 发表于 2010-1-20 11:01:00

<p>这个例子很好,谢谢楼主。</p>

yg545france 发表于 2010-1-31 13:49:00

<p>楼主能解释一下这段代码的功能吗</p>

yg545france 发表于 2010-2-1 23:36:00

明白了,找到标注对象,放到尺寸线层里去
页: [1]
查看完整版本: 选择集应用一例