[讨论]请问如何恢复块定义
图纸中有很多块参照,但却没有块定义,请问如何才能恢复这些块参照的块定义[讨论]没想到竟这么简单
<p>Sub ReSetBlockReference()<br/>'恢复块定义<br/> On Error Resume Next<br/> <br/> Dim blockEnt As AcadBlockReference<br/> Dim blkName As String<br/> Dim getobj As Object<br/> Dim p As Variant<br/> Dim i As Integer<br/> <br/> Dim ssetObj As AcadSelectionSet<br/> If Not IsNull(ThisDrawing.SelectionSets.item("Example")) Then<br/> Set ssetObj = ThisDrawing.SelectionSets.item("Example")<br/> ssetObj.Delete <br/> End If<br/> Set ssetObj = ThisDrawing.SelectionSets.Add("Example")<br/> ThisDrawing.Utility.InitializeUserInput 0, <br/> ssetObj.SelectOnScreen</p><p> For i = 0 To ssetObj.count - 1<br/> Set blockEnt = ssetObj(i)<br/> blockEnt.Name = blockEnt.Name<br/> Next<br/> ssetObj.Delete </p><p>End Sub</p>
页:
[1]