Tell if .rvt file is detached from Central without the model

So we are an MEP Contractor.
How to go about a dynamo to check if the Arch, Structural models have been detached from central WITHOUT actually opening the model?

You can’t check the contents of a file without opening it.

1 Like

Seconding what @jacob.small said.

Dynamo works on the basis of the already opened Dynamo file. No real way around that, that’s how the entirety is set up.

You could attempt to gather the data via a background open, but corruption would be a possible result and there wouldn’t be more than a half second’s worth of time saved.

Actually it is possible using the Revit API without fully opening the document. Example function in python:

def IsLocalModel(revitFilePath):
  isLocalModel = False
  basicFileInfo = BasicFileInfo.Extract(revitFilePath)
  if basicFileInfo is not None:
    isWorkshared = basicFileInfo.IsWorkshared
    if isWorkshared:
      # NOTE: see: https://forums.autodesk.com/t5/revit-api-forum/basicfileinfo-iscreatedlocal-property-outputting-unexpected/td-p/7111503
      isLocalModel = (basicFileInfo.IsCreatedLocal or basicFileInfo.IsLocal)
  return isLocalModel

This IsLocalModel() function will tell you whether or not the file is a local file (if it’s not it’s either detached or a non-workshared model).

3 Likes