Sub dxzd()'选择对象然后更改绘图次序 Dim ss As AcadSelectionSet Dim arr() As AcadObject Dim eDictionary As Object Dim sentityObj As Object Set eDictionary = ThisDrawing.ModelSpace.GetExtensionDictionary Set sentityObj = eDictionary.GetObject("ACAD_SORTENTS") If sentityObj Is Nothing Then Set sentityObj = eDictionary.AddObject("ACAD_SORTENTS", "AcDbSortentsTable") End If Set ss = ThisDrawing.SelectionSets.Add("ss") ss.SelectOnScreen ReDim arr(0 To (ss.Count - 1)) As AcadObject For i = 0 To ss.Count - 1 Set arr(i) = ss.Item(i) Next ss.Delete sentityObj.MoveToBottom arr'置底 'sentityObj.MoveToTop '置顶 AcadApplication.Update End Sub |