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