这里最好改下? Public Function CreateSelectionSet(Optional ssName As String = "ss") As AcadSelectionSet Dim ss As AcadSelectionSet On Error Resume Next Set ss = ThisDrawing.SelectionSets(ssName) If Err Then Set ss = ThisDrawing.SelectionSets.Add(ssName) ss.Clear Set CreateSelectionSet = ss End Function -》 Public Function CreateSelectionSet(Optional ssName As String = "ss") As AcadSelectionSet On Error Resume Next ThisDrawing.SelectionSets(ssName).delete Set CreateSelectionSet = ThisDrawing.SelectionSets.Add(ssName) End Function |