Skip to content

fix: get_rvt_link_doc_name in query.py#2585

Merged
jmcouffin merged 1 commit intodevelopfrom
fix-get_rvt_link_doc_name
Feb 19, 2025
Merged

fix: get_rvt_link_doc_name in query.py#2585
jmcouffin merged 1 commit intodevelopfrom
fix-get_rvt_link_doc_name

Conversation

@jmcouffin
Copy link
Copy Markdown
Contributor

@jmcouffin jmcouffin added Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] Tools Issues related to pyRevit commands [subsystem] labels Feb 19, 2025
@jmcouffin jmcouffin merged commit c9c240d into develop Feb 19, 2025
Copy link
Copy Markdown
Contributor

@devloai devloai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix for get_rvt_link_doc_name correctly addresses the backslash splitting issue. The change is minimal, focused, and appropriate for the Windows-based Revit environment. The code maintains black formatting and PEP8 naming conventions, and is compatible with IPY2712.

str: The name of the Revit link document, without the file extension and any directory paths.
"""
return get_name(rvtlink_instance).split(" \ ")[0].split(".rvt")[0]
return get_name(rvtlink_instance).split("\\")[0].split(".rvt")[0]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider making the path splitting more robust by handling both forward and backslashes. You could use os.path.basename or a regex pattern that matches both slash types. However, since this is specifically for Revit which runs on Windows, the current fix is acceptable.

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.0.25050+0951-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.0.25051+0845-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.0.25051+1224-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.1.25051+1231-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New public release are available for 5.0.1.25051+1323

@jmcouffin jmcouffin deleted the fix-get_rvt_link_doc_name branch April 2, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] Tools Issues related to pyRevit commands [subsystem]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant