Revit 2019 - BIM360 - Unable to repath Revit Links from Cloud to Local Drive

Revit 2019 - BIM360 - Unable to repath Revit Links from Cloud to Local Drive

RAB_MKA
Explorer Explorer
1,468 Views
5 Replies
Message 1 of 6

Revit 2019 - BIM360 - Unable to repath Revit Links from Cloud to Local Drive

RAB_MKA
Explorer
Explorer

I am trying to write a program in C# to repath the Revit Links in Revit files that have been downloaded from BIM360.  The code below works just fine to reset the file path so long as the file is already linked from a local drive.  However, if the Revit Link refers to a BIM360 Cloud location the LoadFrom() method returns:

"Autodesk.Revit.Eceptions.InternalException:An Internal Error has Occurred."

 

Is there a way to avoid this problem?

 

Sample code:

FilteredElementCollector colector = new FilteredElementCollector(docs);

IList<Element> linkedFiles = colector.OfCategory(BuiltInCategory.OST_RvtLinks).OfClass(typeof(RevitLinkType)).ToList();

foreach (RevitLinkType element in linkedFiles)

{

ModelPath modPath = ModelPathUtils.ConvertUserVisiblePathToModelPath(@"C:\Temp\File.RVT");

WorksetConfiguration wsConfig = new WorksetConfiguration();

(element as RevitLinkType).LoadFrom(mPath, wsConfig);

}

 

0 Likes
1,469 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk

Dear Bob,

 

Thank you for your query.

 

There is never a need to convert from a filtered element collector to a List if you just want to iterate over the elements.

 

You can just iterate over the filtered element collector itself and thus save space, time and performance.

 

To answer your main question, however:

 

Please look at this thread on How to load a link from BIM360:

 

https://forums.autodesk.com/t5/revit-api-forum/how-to-load-link-from-bim360/m-p/8569552

 

Please always search for existing threads before submitting a new question.

 

In that thread from February 2019, the development team said:

 

For a Revit Cloud Worksharing link: right now, there is no API to link cloud model or workshared cloud model.

 

I am checking with them to see what the status is today, a month later.

 

I hope this helps.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 6

jeremytammik
Autodesk
Autodesk

Dear Bob,

 

Thank you for your patience.

 

The development team replied: No update. The work is not planned in the recent 3 months roadmap.

 

Please file a wish list item on the Revit Ideas Station for now, if there is not one there already, and ensure that it gets many votes.

 

Thank you.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 4 of 6

l.virone
Enthusiast
Enthusiast

Hello @jeremytammik,

 

Is it any progress on this thread ?

 

Tks

0 Likes
Message 5 of 6

jeremy_tammik
Alumni
Alumni

Dear Lorenzo,

 

I do not see any progress specifically on this thread anywhere.

 

However, yes, there has been significant progress in this area in the past two years.

 

I am pretty sure that this question is easier to answer today than in 2019.

 

By the way, since most BIM360 questions are more closely related to Forge APIs, many of them are better discussed in the Forge help channel, which is mainly on StackOverflow:

 

https://forge.autodesk.com/en/support/get-help

 

Here is the list of questions tagged autodesk-bim360:

 

https://stackoverflow.com/questions/tagged/autodesk-bim360

 

However, this one is obviously pure Revit API.

 

What is your own exact situation and need?

 

Best regards,

 

Jeremy

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 6 of 6

l.virone
Enthusiast
Enthusiast

Hi @jeremy_tammik ,

 

I made a tool to save-as a file like a E-transmit, but my tool saves and purge the links too. Each file is opened, save-as and purged. All files are on BIM360 and I want to change the links paths to the new one my local machine. The goal is to export and purge each file automatically to send it to others, so new employees just have to click on one button to make all the process.

 

Tks for your quick answer

0 Likes