AutoCAD Map 3D Developer

Reply
Member
suresh738
Posts: 5
Registered: ‎10-20-2003
Message 1 of 2 (53 Views)

Puging a block

53 Views, 1 Replies
07-01-2002 02:34 PM
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.
*Ajayi, Gabriel
Message 2 of 2 (53 Views)

Re: Puging a block

07-10-2002 11:56 PM 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.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.