没有高手出面,自立更生啦,看下面的程序吧!
Sub main() Dim obj As AcadEntity, pt As Variant, selobj As AcadEntity, ssetobj As AcadSelectionSet ThisDrawing.Utility.GetEntity obj, pt: obj.Highlight True On Error Resume Next ThisDrawing.SelectionSets("j").Delete Err.Clear Set ssetobj = ThisDrawing.SelectionSets.Add("j") ssetobj.SelectOnScreen
Dim cmd As String cmd = "pe" & vbCr & "(handent """ & obj.Handle & """)" & vbCr & "j" & vbCr Dim i As Integer For i = 0 To ssetobj.Count cmd = cmd & "(handent """ & ssetobj.Item(i).Handle & """)" & vbCr Next
ThisDrawing.SendCommand cmd & vbCr & vbCr End Sub |