Repath BIM360 Links

I am attempting to repath Revit links from local server locations to BIM360 Cloud paths. My current workflow involves collecting the newly pushed model’s BIM360 Project GUID and Model GUID and writing to memory, excel in my case.

I am then trying to retrieve that data later in the process to generate BIM360 cloud paths via a python script that utilizes ModelPathUtils.ConvertCloudGUIDsToCloudPath(). See first block of code below.

I then attempt to feed in a RevitLinkType element and the newly created Cloud path into another python script to basically perform a reload from action. This is where my script is failing. See second block of code below.

Is what I am attempting to do even possible? Any assistance anyone is willing to offer to help me to get this to work or point me in the right direction would be greatly appreciated. Thank you in advance!

Create Cloud path Python:

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

from System.Collections.Generic import *

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Analysis import *

pID = IN[0]
mID = IN[1]

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

doc = DocumentManager.Instance.CurrentDBDocument
x = doc.Title
path = ModelPathUtils.ConvertCloudGUIDsToCloudPath(pID, mID);

OUT = path

Reload Links Python:

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

from System.Collections.Generic import *

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Analysis import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

linkType= UnwrapElement(IN[0])
cloudPaths = IN[1]
config = WorksetConfiguration()
listOut = []

for i in linkType:	
	try:
		i.LoadFrom(cloudPaths, config)
		listOut.append(i)
	except:
		listOut.append("Failure")

OUT= listOut
4 Likes

I have a more rudimentary version of this that I am trying to piece together, I am way to new to dynamo and python so I am having to use others code to try and get this to work, the issue I have run into is that Loadfrom will not accept the cloud path. Just wanted to see if you had come up with a resolution to your issue or if someone else would by chance be able to help with this…

1 Like

Hi both, did you make any progress with the above? I’m looking at something similar, where I’d like to batch import rvt files that are hosted on BIM360. I’ve so far only been able to make it work with the local cached versions.

Was wondering the same, have more than 500images need to be “reload from” MANUALLY… from local server to BIM360 cloud.

Any of you guys tried this?

2 Likes

I had, but it was made for non bim360 links i do believe. There is a package called Sparrow from Majd Makhlouf that is a great start to this idea, though it requires quite a bit of manually entry. I think that and a mixture of what is covered in this link will be needed to achieve it though. I plan on restarting this attempt in the next few weeks, so once I get a resolution I will post it here. The Building Coder: Access BIM360 Cloud Links, Thumbnail and Dynamo

example
The fix to the loadfrom is along these lines

1 Like

did you find a solution? I have same questions

1 Like

not this exact idea, but I was able to make another script that finds all keywords from a links workset names(such as grids, levels, scope boxes, hidden), unloads the link, closes all worksets, and reopens all except the worksets included from the prior step, then reloads each link. it works for any 2019+ BIM360 link. I have two version of this, one that does a single link and one that does all links in the model. I need to clean it up more so it is 90% python to remove some of the unneeded items from some of the nodes but all in all it is functional and saves me a load of clicks.

The snippet above is taken from the main python node in that script and shows the most important logic needed to interact with the links.

1 Like