
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
The following code gets all the files linked or imported in a revit document but how do I get the list of cad files that are linked and not imported:
ModelPath location = ModelPathUtils.ConvertUserVisiblePathToModelPath(doc.PathName);
string path = ModelPathUtils.ConvertModelPathToUserVisiblePath(location);
TransmissionData transData = TransmissionData.ReadTransmissionData(location);
ICollection<ElementId> externalReferences = transData.GetAllExternalFileReferenceIds();
foreach (ElementId refId in externalReferences)
{
ExternalFileReference extRef = transData.GetLastSavedReferenceData(refId);
string ipath=ModelPathUtils.ConvertModelPathToUserVisiblePath(extRef.GetPath());
if (ipath.Contains(".dwg"))
{
string fileName = Path.GetFileName(ipath);
categoryname.Add(fileName);
}
}
Thanks & Regards
Sanjay Pandey
Solved! Go to Solution.