Anyway to get the revit link path for both models linked from ACC (Autodesk Connector) and BIM360 Docs?
1 Like
@PenA ,
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
path = doc.GetCloudModelPath()
OUT = ModelPathUtils.ConvertModelPathToUserVisiblePath(path)
KR
Andreas
3 Likes
Thanks @Draxl_Andreas !
Seems it gives the path of my current model, not link model instead:
May I know how to change it to get all cloud link models’ path?
This post can contains all request you need : How To Get Path BIM360 Revit Linked | CHUONG MEP
# Load the Python Standard and DesignScript Libraries
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
paths = []
def GetExtFileRefPath(item):
try :
dirRefs = item.GetExternalResourceReferences()
for i,v in enumerate(dirRefs):
return v.Value.InSessionPath
except Exception as e: return e.ToString()
doc = DocumentManager.Instance.CurrentDBDocument
items = FilteredElementCollector(doc).OfClass(RevitLinkType).ToElements()
OUT = [GetExtFileRefPath(x) for x in items]
3 Likes
Thanks a lot!! @chuongmep
It’s great! FYI for those links under closed workset / unload, the path cannot be extract, but still can indicate its location, that’s enough for me.
Meanwhile i just make use of the element of revitlinktype to map with the location path result!
2 Likes
Nice @PenA