Message 1 of 2
Retrieving Local File Paths for CADLinkType Elements in a Cloud Model
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to get the local path for some CADLinkType in a cloud model.
All files are downloaded locally and synchronized by DesktopConnector.
The code I am using is:
IList<Element> CADlist = (IList<Element>)new FilteredElementCollector(uiDoc.Document).OfClass(typeof(CADLinkType)).WhereElementIsElementType().ToList<Element>();
foreach (var xref in CADlist)
{
CADLinkType cl = xref as CADLinkType;
if(cl == null)
return;
var erref = cl.GetExternalResourceReferences();
if (erref != null)
{
foreach (var entry in erref)
{
var eri = entry.Value;
if (eri != null)
{
var inSessionPath = ri.InSessionPath;
}
}
}
}
However, the variable inSessionPath remains empty, even though the "Manage Links" in Revit window clearly displays the path as "Autodesk Docs://...".
Could you please show me how can I get the expected values? Is there another approach for this?
I did also try to get the ExternalResourceServer the seems to be handling ADC but without any success:
MultiServerService ms = ExternalServiceRegistry.GetService(ExternalServices.BuiltInExternalServices.ExternalResourceService) as MultiServerService;
b360Server = ms.GetServer(new Guid("d2c3617d-7a16-45bc-b395-44897852f485")) as Autodesk.Revit.DB.IExternalResourceServer;
b360Server.GetInSessionPath()
This server is:
d2c3617d-7a16-45bc-b395-44897852f485. A360ExternalResources.A360ResourceServer, Autodesk Docs, ADSK, This server is the Autodesk Docs Resource Server.
I would appreciate any insights or guidance anyone can provide.
Thank you!