<img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/48ca73dc-b518-4579-b862-f3787bb4df4a/alert.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/48ca73dc-b518-4579-b862-f3787bb4df4a/alert.png" width="40px" /> The bundle file (
_layout) is deprecated and will be removed in the next pyRevit major version.
See Bundle Metadata for directions on defining bundle layouts in bundle metadata files.
Bundle Layout is a method to provide directives on how the child bundles should be ordered in Revit UI.
MyCommands.pulldown/ ├── PushButton A.pushutton ├── PushButton B.pushutton ├── PushButton C.pushutton └── bundle.yaml # bundle metadata file contains the layout directives
For example, below are the layout directives for a UI bundle that includes a few other bundles. Buttons on the Revit UI will be placed according to this layout. The top-most bundles are created first (From left to right in Revit UI), following down the list.
layout: - PushButton A - PushButton B - PullDown A - --- # see **Separator Lines** - PullDown B - Stack3 A - >>> # see **Slide-out Panel** - PushButton C - PullDown C
Panel and Pull Down Bundle layout files can contain a directive to place a vertical (in panels) or horizontal (in pull-downs) separator line in between buttons.
--- This line will add a separator to the interface. You can use more than 3
- characters. For example
---------- still works as a separator.
layout: - PushButton A - PushButton B - PullDown A - --- - PushButton B
Panel Bundle (Only) layout file can contain a directive to place buttons inside the slide-out area of the panel.
>>> Any bundle after this line will be created inside the slide-out. You can use more than 3
> characters. For example
>>>>>>>>> still works as a slide-out
<img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/43be339d-9a34-4111-945d-24e1d5a3e923/alert.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/43be339d-9a34-4111-945d-24e1d5a3e923/alert.png" width="40px" />
>>> must be encapsulated inside double quotes as
">>>" to comply with YAML format
layout: - PushButton A - PushButton B - PullDown A - ">>>" - PushButton C - PullDown C
Layouts can also contain directives on renaming buttons, or their placement in relation to other buttons on the toolbar. This is especially helpful to direct pyRevit to place your buttons in relation to buttons from other extensions. These directives are placed inside the
[before:<other bundle name>]
[after:<other bundle name>]
# examples # title directive (\\n is escape code for new line) # this directive renames the bundle "Misc Tests" -> "Third-Party" # " Unittests " layout: - Misc Tests[title:Third-Party\\nUnittests] # before directive # this directive places "Manage Tags" before "Modify" layout: - Manage Tags[before:Modify] # beforeall directive # this directive places "pyRevit" before everything else layout: - pyRevit[beforeall:]