Message 1 of 2
path information for linked CAD files from BIM360 Docs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
We are trying to get the path information for linked CAD files. We can get path information except when it is a file linked through the desktop connector to BIM 360. Would you please have a look at the code snippet and help us out?
code snippet: ... var element = document.GetElement(c.GetTypeId()); try { if (element.IsExternalFileReference()) { // OK: we have access to the path... var externalFileReference = element.GetExternalFileReference(); path = ModelPathUtils.ConvertModelPathToUserVisiblePath(externalFileReference.GetAbsolutePath()); } else { // Not an external file reference: how to get access to the (server)path? var bar = element.GetExternalResourceReferences().First(); var externalResourceReference = element.GetExternalResourceReference(bar.Key); // This does not work, because element.UniqueId is not an GUID (has extra characters at the end). // If I remove these extra characters, I get a GUID, but then I get an exception saying "You are unauthorized to access this resource." var cloudPath = ModelPathUtils.ConvertCloudGUIDsToCloudPath(externalResourceReference.ServerId, Guid.Parse(element.UniqueId)); path = cloudPath.CentralServerPath; } } catch (Exception ex) { path = "N/A"; } ...