我写了个保存块的程序,但是保存不了,那位大虾帮帮忙啊! Private Sub cmdSave_Click() Dim uSset As AcadSelectionSet Dim iCount As Integer Dim AcadObject As AcadBlock Dim uBlock(1 To 1) As AcadBlock Set uSset = ThisDrawing.SelectionSets.Add("WBLOCKSET10") For Each AcadObject In ThisDrawing.Blocks If AcadObject.IsLayout = False And AcadObject.Name = ListBox1.Text Then '列表框的内容是要保存的块的名字 Set uBlock(1) = AcadObject End If Next uSset.AddItems uBlock 'msgbox uSset.count '我作了下测试,uSset.count还是0.那就是说uSset.AddItems uBlock没有添加成功,这事为什么啊? ThisDrawing.Wblock "C:\block.dwg", uSset uSset.Delete End Sub |