fix: get_rvt_link_doc_name in query.py#2585
Conversation
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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.
|
📦 New work-in-progress (wip) builds are available for 5.0.0.25050+0951-wip |
|
📦 New work-in-progress (wip) builds are available for 5.0.0.25051+0845-wip |
|
📦 New work-in-progress (wip) builds are available for 5.0.0.25051+1224-wip |
|
📦 New work-in-progress (wip) builds are available for 5.0.1.25051+1231-wip |
|
📦 New public release are available for 5.0.1.25051+1323 |
ref: https://discourse.pyrevitlabs.io/t/query-get-name-error/8684/17