AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Puging a block

1 REPLY 1
Reply
Message 1 of 2
suresh738
219 Views, 1 Reply

Puging a block

Hi, i am facing a problem while purging blocks. i want to purge a perticular block through vba. i could able to use only purgeall command from vba. how can i giva an option to select a block name which has to be purged.
If any one is havig idea in this, please tell me.
Thanks & Regards
Suresh.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: suresh738

You can search the block reference and block by
name and delete them.

 

 

'This will delete block reference

For i = 0 To ThisDrawing.ModelSpace.Count -
1

 

 Set ent =
ThisDrawing.ModelSpace.Item(i)

 

If ent.ObjectName = "AcDbBlockReference"
Then

 

 Set blockRef = ent
 
 If
bref.Name = "Your BlockRefenceName" Then

    blockRef .Delete

    Exit For

 End If
 
End If

 

'This will delete the block

For i = ThisDrawing.Blocks.Count - 1 To 0 Step
-1

 

Set block = ThisDrawing.Blocks.Item(i)

 

if block.Name = "YourBlockName"
then 

 block.Delete

 Exit For
End If 


Next

 

 

Gabriel




style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi,
i am facing a problem while purging blocks. i want to purge a perticular block
through vba. i could able to use only purgeall command from vba. how can i
giva an option to select a block name which has to be purged.
If any one
is havig idea in this, please tell me.
Thanks & Regards

Suresh.

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

Post to forums  

Autodesk Design & Make Report

”Boost