Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Changing a Cloud Revit Link to Local Revit Link RevitLinkType.LoadFrom

david_rock
Enthusiast

Changing a Cloud Revit Link to Local Revit Link RevitLinkType.LoadFrom

david_rock
Enthusiast
Enthusiast

Hello,

I would like to change the paths of Revit Linked models from a cloud location to a local path location.

I'm using the following code:

RevitLinkType.LoadFrom(ModelPath, new WorksetConfiguration())

When RevitLinkType is derived from a cloud model I receive:

I receive the error: An internal error has occurred.

When RevitLinkType is derived from a local path the model is reloaded.

Kind Regards

David

 

0 Likes
Reply
Accepted solutions (1)
981 Views
3 Replies
Replies (3)

jeremytammik
Autodesk
Autodesk

Dear David, I am asking the development team for you... hang on. Cheers, Jeremy (personal link)

 



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

0 Likes

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear David,

 

Thank you for your patience. 

 

The development team reply:

 

That's supposed to work. Please submit a complete, minimal, self-contained reproducible case for the development team to reproduce and analyse the problem:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 
I don't know if this next suggestion will work, but as a workaround you could try making an ExternalResourceReference object using ExternalResourceReference.CreateLocalResource() and then calling the version of LoadFrom() which takes an ExternalResourceReference instead of a ModelPath.

 

I hope this helps.

 

Cheers,

 

Jeremy

 



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

david_rock
Enthusiast
Enthusiast

Thank you,

I tried using:

ExternalResourceReference.CreateLocalResource()

And it worked....

If objRevitLinkType.IsFromLocalPath Then
    objRevitLinkType.LoadFrom(objRockitLinkItem.objModelPath, Nothing)
Else
    Dim objExternalResourceType As ExternalResourceType = ExternalResourceTypes.BuiltInExternalResourceTypes.RevitLink
    Dim objExternalResourceReference As ExternalResourceReference = ExternalResourceReference.CreateLocalResource(activeDBdoc, objExternalResourceType, objRockitLinkItem.objModelPath, PathType.Absolute)
    objRevitLinkType.LoadFrom(objExternalResourceReference, Nothing)
End If

Thank you very much.

kind Regards

David

 

0 Likes