' 返回当前模型空间中最后一个实体方法一 Dim InsertBlock As Object Set InsertBlock = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1) ' 返回当前模型空间中最后一个实体方法二
Dim SSet As OBJECT Dim InsertBlock As OBJECT On Error Resume Next Set SSet = ThisDrawing.SelectionSets("ss") If Err Then Set SSet = ThisDrawing.SelectionSets.Add("ss") SSet.Select acSelectionSetLast '注意这里 acSelectionSetLast !! Set InsertBlock = SSet.Item(0) Set SSet = Nothing ThisDrawing.SelectionSets("ss").Delete |