Retrieving Local File Paths for CADLinkType Elements in a Cloud Model

Retrieving Local File Paths for CADLinkType Elements in a Cloud Model

lucian.ungureanu3QT72
Explorer Explorer
201 Views
1 Reply
Message 1 of 2

Retrieving Local File Paths for CADLinkType Elements in a Cloud Model

lucian.ungureanu3QT72
Explorer
Explorer

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://...".

lucianungureanu3QT72_0-1737442880497.png

 

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!

 

0 Likes
202 Views
1 Reply
Reply (1)
Message 2 of 2

lucian.ungureanu3QT72
Explorer
Explorer

Followup question: is there a way to get the BIM360 path for the cadlink from a cloud model opened in Revit locally (Desktop connector)?

0 Likes