VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

unreferenced blocks

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
145 Views, 3 Replies

unreferenced blocks

How do I "purge" unreferenced block names out of my drawing with VB? I noticed the Document object has a PURGEALL method, but I don't want to purge everything.
3 REPLIES 3
Message 2 of 4
joesu
in reply to: Anonymous

PRE
Public Sub PurgeBlocks()
Dim Block As AcadBlock
Dim Index As Long

On Error Resume Next

For Index = 0 To ThisDrawing.Blocks.Count - 1
If InStr(1, Blocks(Index).Name, "*") = 0 Then
Blocks(Index).Delete
End If
Next
End Sub
/PRE

Joe
--
Message 3 of 4
joesu
in reply to: Anonymous


Public Sub PurgeBlocks()
Dim Block As AcadBlock
Dim Index As Long

On Error Resume Next

For Index = 0 To ThisDrawing.Blocks.Count - 1
If InStr(1, Blocks(Index).Name, "*") = 0 Then
Blocks(Index).Delete
End If
Next
End Sub


Joe
--
Message 4 of 4
Anonymous
in reply to: Anonymous

Thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost