刚用VB开发CAD,刚学会创建块
Dim block1 As AcadBlock
''''block1.Delete
Set block1 = ThisDrawing.Blocks.Add(pnt, "耳座1")
ThisDrawing.CopyObjects obj, block1
For i = 0 To 6
obj(i).Delete
Next i
Set oj = ThisDrawing.ModelSpace.InsertBlock(pnt, "耳座1", 1, 1, 1, 0)
如何判断图中存不存在某个块
If Not ThisDrawing.Blocks(耳座1) Is Nothing Then
Call remove_block("耳座1")
ThisDrawing.Blocks("耳座1").Delete
End If
Set block1 = ThisDrawing.Blocks.Add(pnt, "耳座1")
If Not ThisDrawing.Blocks(耳座1) Is Nothing Then 这句话有什么毛病?首次打开图形图中无块的时候就块出错,要加on error语句,图中有块就不出错了,为什么