External References
Information on External References
DwgList DLL can easily provide information about External References (XRefs) in the DWG file. The DWG file must be opened using the dwglist_ProcessFile command(see Initialization). Processing XRefs is very simple. You call dwglist_getNumberOfXrefs to get the number of XRefs in the file, then you loop through each XRef to get the information about it. Currently you can only get the XRef file name using the dwglist_getXrefName command, but if you need more information like path, status, etc., let us know and we can easily add it.
int numXrefs = dwglist_getNumberOfXrefs();
if (numXrefs > 0)
{
cout << "External References" << endl << "===================" << endl;
for (int i = 0; i < numXrefs; i++)
{
string xrefName = dwglist_getXrefName(i);
cout << xrefName << endl;
}
}
else
cout << "No External References in DWG file" << endl;