Private Sub CommandButton1_Click() UserForm1.Hide On Error Resume Next Dim sset As AcadSelectionSet If Not IsNull(ThisDrawing.SelectionSets.Item("Example")) Then Set sset = ThisDrawing.SelectionSets.Item("Example") sset.Delete End If Set sset = ThisDrawing.SelectionSets.Add("Example") sset.SelectOnScreen ' 在选择集中循环并将每一对象的颜色改为蓝色。 Dim entry As AcadEntity For Each entry In sset entry.color = acRed entry.Offset (CDbl(UserForm1.TextBox1.text)) entry.color = acWhite entry.Update Next entry If UserForm8.CheckBox1.Value = True Then For Each element In sset element.Delete Next End If sset.Delete End End Sub ------------------------------------ 上面VBA代码,怎样可以改成VB代码,明经兄弟请帮忙 ------------------------------------------ |