oh right, so even adding:
' Checks if table exists and redefines (clearsout) the block of all data..
Function CleanoutBlock(currentBlock As AcadBlock)
Dim blkItem As AcadEntity
[color=red]Dim blkAtt As AcadAttribute[/color]
For Each blkItem In currentBlock
blkItem.Delete
Next blkItem
[color=red] For Each blkAtt In currentBlock
blkAtt.Delete
Next blkAtt[/color]
End Function
...to your function won't work?
I tried it, but still nothing. All i want to do is delete the attributes (and all block entities) from the block, so its empty and then put back all the stuff the program does in the block, so if there any blocks the user has inserted anywhere, the blocks will reflect what the user chooses in the program..
Here's a brief lowdown an what the program does: It creates a fixings chart / table from user defined data (the user can also pick a fixing from an inserted block in a drawing and it will enter the block name in the textbox for that chosen fixing. There are 10 possible rows to create, each one selected / deselected by checkbox. When run, it adds two types of attribute for each row to the table / chart, one is the reference number for the item (a constant) (ie: FX1, FX2 etc), the second is the description (a normal) which the user can edit in the text boxes on the userform. When loaded (userform_Initialise), the program searches for any existing insert of the table and populates the userform with that data, so the user can edit / add to / delete from etc.. and when completed, it inserts the block (if new / no existing table was found) or just updates the existing..
Now with my code (and Keith's addition), it works 99% but just won't delete the existing normal attributes (it DOES however delete the constant attributes (the reference ones)..
I thought, as it deletes these constant attributes (all attributes in this program created by Block.AddAttribute by the way) it would also delete the normal ones too, but it doesn't. Is this because of the 'constant' property of the attribute?