add support for content and content_alt in bundle file#2862
add support for content and content_alt in bundle file#2862jmcouffin merged 4 commits intopyrevitlabs:developfrom
Conversation
…aming convention kept.
|
And after hitting send i noticed there might be an api for checking version info... https://www.revitapidocs.com/2022/475edc09-cee7-6ff1-a0fa-4e427a56262a.htm |
There was a problem hiding this comment.
PR Summary:
This PR adds support for content and content_alt flags in bundle YAML files for ContentButton components. This allows users to specify Revit family (.rfa) file paths directly in the bundle metadata, supporting both absolute and relative paths. The implementation preserves backward compatibility by falling back to the naming convention (_content.rfa, content_{version}.rfa) when metadata is not provided.
Review Summary:
The implementation correctly adds the new feature with proper fallback logic. However, there are two medium-severity issues related to error handling and validation that should be addressed to improve debuggability and robustness. The code follows Black formatting and PEP8 conventions as required.
Follow-up suggestions:
Support for absolute and relative paths - Introduced new .rfa files for bundle tests. - Updated bundle.yaml to include additional test cases for content bundles. - Added new content bundles with specified paths and icons for better organization and testing.
|
This is a cool one. Thanks @Wurschdhaud
|

Description
Add "content" and "content_alt" as flags for the bundle file.
Fallback to content in family name is preserved, so it shouldn't break any scripts.
Usage examples:
or, if simply in the same folder:
Note:
Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}Related Issues
If applicable, link the issues resolved by this pull request:
Additional Notes
Great help by deepwiki. What a powerful tool. Don't know if the code is "pretty" enough though, pls verify.
Thank you for contributing to pyRevit! 🎉