I have write a vba program that places a block in a drawing.
If the user delete the block then runs the program it loads the original block with two more attributes.
Is there a purge command in VBA for a getting rid of the first block.
my selection set dose not find the first deleted block
'This subroutine will find if the item mark balloon block already exists in the drawing
'we will filter the selection by all INSERTed blocks named CONBALL
Grps(0) = 0: Dats(0) = "INSERT"
Grps(1) = 2: Dats(1) = "CONBALL"
On Error Resume Next
'add the selection set to the drawing
Set SS = ThisDrawing.SelectionSets.Add("SS")
'if the selection set already exists an error will be thrown
'in that case just set the selection set equal to the existing one
If Err.Number <> 0 Then
Set SS = ThisDrawing.SelectionSets.Item("SS")
End If
'before we add anything to the selection set, clear any existing objects from it
SS.Clear
'set the filter variables from the dxfcodes
Filter1 = Grps
Filter2 = Dats
'put all the instances of the Item into the selection set
SS.Select acSelectionSetAll, , , Filter1, Filter2
If SS.Count = 0 Then
'need to purge CONBALL incase it was created and deleted
'ThisDrawing.PurgeAll.CONBALL
'if there is no conduit balloon then prompt for number.
frmConduitnum.Show
Create_Balloon
Else
is there somthing I can do wiht the selection set
Thanks


Reply With Quote
