Sunday, 20 July 2014

Remove TB2 entities from drawing

Here is a little c# application which deletes TB2 entities from a drawing.
We have one project where TB2 saves drawings containing TB2 entities. Moving to Map we need to remove these entities but keep all non-TB2 drawing objects.

The application:
- checks whether a drawing entity has XDATA or not, if there is any XDATA the app checks whether XDATA contains the string "FID:", if so, the object gets deleted
- purges all layers
- creates one new layer (fixed name)
- removes non-TB2 objects on one specific layer (fixed name)
- creates a log file and lists all drawings which could not be processed

The app runs within AutoCAD, you only need to specify the folder where the files are stored (
netload, command: win_deletetb2entities).

Source code is attached as well. Maybe it is useful for someone else.

AutoCAD Map 2013, SP2

No comments:

Post a Comment