Skip to content

[Limitation]: ADC Lib does not generate local paths properly #2839

@tay0thman

Description

@tay0thman

✈ Pre-Flight checks

  • I don't have SentinelOne antivirus installed (see above for the solution)
  • I have searched in the issues (open and closed) but couldn't find a similar issue
  • I have searched in the pyRevit Forum for similar issues
  • I already followed the installation troubleshooting guide thoroughly
  • I am using the latest pyRevit Version

🐞 Describe the bug

Trying to build few tools that utilize the pyrevit.interop.adc.

The available function does not generate a valid path "WorkspaceLocation"//

Current ADC API only report HubId and ProjectId, which are ForgeTypeIds, to get the display name we need to incorporate Autodesk Platform Services and get a token and complicate things more.

Right now, I am suggesting getting the Organization name by using os.walk , not the most efficient but it gets the work done.

Here is the function I am proposing to add to the ADC library.

def _get_organization_name(drv_info, path):
    drive_schema = ADC_DRIVE_SCHEMA.format(drive_name=drv_info.Name)
    parts = path.replace(drive_schema, "").split('/')
    file_name = parts[1] if len(parts) > 1 else ""
    drv_local_path = op.normpath(drv_info.WorkspaceLocation)
    subdirs = os.walk(drv_local_path)
    for root, dirs, files in subdirs:
        for f in files:
            if f == file_name:
                file_path = op.join(root, f)
                org_name = file_path.replace(drv_local_path, "").split(os.sep)[1]
                return org_name

⌨ Error/Debug Message

I get a file that does not exists

♻️ To Reproduce

No response

⏲️ Expected behavior

a local file path should be generated properly.

🖥️ Hardware and Software Setup (please complete the following information)

Revit 2025 , Pyrevit WIP

Additional context

No response

Metadata

Metadata

Assignees

Labels

Not pyRevit IssueThis is not a pyRevit issue. Might be related to environment, host app, or other dependencies.Requires Cloud AccessIssues related to compatibility with any of the cloud services

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions