Sub MoveEnt() Dim Objentity As AcadEntity Dim Sset As AcadSelectionSet ' On Error Resume Next If Not IsNull(ThisDrawing.SelectionSets.Item("ss1")) Then Set Sset = ThisDrawing.SelectionSets.Item("ss1") Sset.Delete End If Set Sset = ThisDrawing.SelectionSets.Add("ss1") Dim Pt1 As Variant Dim Pt2 As Variant Pt1 = ThisDrawing.Utility.GetPoint(, "请选择第一点") Pt2 = ThisDrawing.Utility.GetPoint(, "请选择第二点") Sset.SelectOnScreen For Each Objentity In Sset Objentity.Move Pt1, Pt2 Next MsgBox Sset.Count End Sub
你试试,可以啊
|