Hi,
I am trying to Bind Xref and Explode them.
When i tried to Bind Xref i get an error as "eInvaid Key"
The following is the code that i am using
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
ObjectIdCollection btrCol = new ObjectIdCollection();
using (tr)
{
XrefGraph xrgraph = doc.Database.GetHostDwgXrefGraph(false);
for (int i = 1; i < xrgraph.NumNodes; i++)
{
XrefGraphNode xrNode = xrgraph.GetXrefNode(i);
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(xrNode.BlockTableRecordId, OpenMode.ForRead);
if (btr.IsFromExternalReference)
{
switch (xrNode.XrefStatus)
{
case Autodesk.AutoCAD.DatabaseServices.XrefStatus.Resolved:
btrCol.Add(btr.ObjectId); break;
}
}
}
}
doc.Database.BindXrefs(XrefIds, true);