Do you mean something like this?
public static void RSNNSSDelXdataAll()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
Database db = HostApplicationServices.WorkingDatabase;
Transaction myT = db.TransactionManager.StartTransaction();
try
{
string AppName = "RSNN_Selection";
TypedValue[] filList = new TypedValue[1];
//Build a filter list so that only block references are selected
filList[0] = new TypedValue((int)DxfCode.ExtendedDataRegAppName, AppName);
SelectionFilter filter = new SelectionFilter(filList);
//user selection will pick only Appname ents
PromptSelectionResult res = ed.SelectAll(filter); //all ents with Appname
//Do nothing if selection is unsuccessful
if (res.Status != PromptStatus.OK)
return;
Autodesk.AutoCAD.EditorInput.SelectionSet SS = res.Value;
ObjectId[] idArray;
idArray = SS.GetObjectIds();
ResultBuffer buf = new ResultBuffer();
buf.Add(new TypedValue((int)DxfCode.ExtendedDataRegAppName, AppName));
//collect all employee details in saEmployeeList array
foreach (ObjectId objId in idArray)
{
Entity tmpEnt = (Entity)myT.GetObject(objId, OpenMode.ForWrite);
if (tmpEnt != null)
tmpEnt.XData = buf;
}
myT.Commit();
}
catch (System.Exception)
{
myT.Commit();
throw;
}
finally
{
myT.Dispose();
}
}
--
Roland Feletic