Skip to content

Commit

Permalink
fix local path
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantondahmen committed Jun 13, 2022
1 parent 29cba53 commit 30ced93
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions revitron/analyze/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,22 @@ def _getLocalPath(self, model):
else:
modelGUID = model['modelGUID']
projectGUID = model['projectGUID']
directory = 'C:\\Users\\{}\\AppData\\Local\\Autodesk\\Revit\\Autodesk Revit {}\\CollaborationCache'.format(
os.getenv('username'), pyrevit.HOST_APP.uiapp.Application.VersionNumber
)
pattern = os.path.join(
directory, '*', projectGUID, '{}.rvt'.format(modelGUID)
)
files = glob.glob(pattern)
try:
return files[0]
except:
return ''
fileName = os.path.join(projectGUID, '{}.rvt'.format(modelGUID))
cliRuntimeCache = os.path.join(os.getcwd(), '_CC', fileName)
if os.path.isfile(cliRuntimeCache):
return cliRuntimeCache
else:
cache = r'C:\Users\{}\AppData\Local\Autodesk\Revit\Autodesk Revit {}\CollaborationCache'.format(
os.getenv('username'),
pyrevit.HOST_APP.uiapp.Application.VersionNumber
)
pattern = os.path.join(cache, '*', fileName)
files = glob.glob(pattern)
try:
return files[0]
except:
return ''
return ''


class DataProviderResult:
Expand Down

0 comments on commit 30ced93

Please sign in to comment.