I have a standalone .NET 2.0 application which uses the COM API to control AutoCAD. The application is written in Visual Studio 2005 in VB.NET.
While running this application the AcSelectionSet.Select(AcSelect.acSelectionSetAll, , , FiltType, FiltData) method is called to retrieve some entites from multiple AutoCAD drawings. The Filters are set to return only Block References, Mtext and Text entities, which they appear to do except...
...for some bizarre reason, the Selection Set returns containing three separate instances of one entity (Identical handle - the works) in amongst all the rest. The entity is a peice of AcDbText, yet there are other Dtext entities in the drawing which are only returned once as you would expect.
It appears to pick the entity up 3 times consecutively as each instance is consecutive with the next in the array.
I've looked very closely at the entity and its properties in AutoCAD but see nothing unusual about it.
Has any one else witnessed this behaviour? I don't know if this is peculiar to COM in .NET 2.0 as I haven't tried to reproduce this in any other language/environment.
This isn't a show stopper as I have put in a filter step to prevent the multiple instances from being persisted elsewhere in the application but it is a little unnerving as I only noticed it when fiddling around debugging something else.
It may be a corrupt entity possibly as saving this drawing out using SaveAs and then running the app on each instance shows it is the same entity in each that gets caught repeatedly.