组码67=1,表示图纸空间 Sub tt() On Error Resume Next Dim ss As AcadSelectionSet ThisDrawing.SelectionSets("Test").Delete Set ss = ThisDrawing.SelectionSets.Add("Test") Dim ft(0) As Integer, fd(0) ft(0) = 67: fd(0) = 1 ss.Select acSelectionSetAll, , , ft, fd For Each obj In ss Dim ent As AcadEntity Set ent = obj Dim owner As AcadBlock Set owner = ThisDrawing.ObjectIdToObject(ent.OwnerID) Debug.Print owner.Name Next End Sub |