.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

bind xref and explode

0 REPLIES 0
Reply
Message 1 of 1
chockalingam
718 Views, 0 Replies

bind xref and explode

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);

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost