Yaml & Spacebar in folders

Hi All,

I am really new to pyRevit and after watching some videos on Youtube i have been eager to get into it to make it easier to run my Dynamo scripts as i can turn my scripts into buttons on a tab at the top of Revit. However i appear to have a couple of minor issues with the layout of it. I would like to have my Panels ordered Worksets / Reinforcement / Drawings

my yaml code is:

However on the screen it shows it as Reinforcement / Worksets / Drawings

Am i doing something wrong?

Also in yaml is it possible to have a space for when you have a space in a file name?
As an example rather than having to do “TestDocument” can you do “Test Document”

Any help would be greatly appreciated!

Hi @Wilko1306 and welcome!

Proper syntax should be

  - Worksets
  - Reinforcement
  - Drawings

sometimes, reloading is not enough and you have to restart Revit to regenerate the UI

You usually can have spaces in file naming. I haven’t encountered issue with that. If the spacing bugs in the file name, you can had double quotes "file name"

Hi @Jean-Marc

Thank you for welcoming me.

i have copied your syntax into my yaml file however they still all appear to be out of order

Where is your yaml file located? Maybe at the wrong folder level?
See, mine, it works, and look at which level it is located

It is located on a server (so all users can access it)

That is what the file path looks like

and that is the bundle at that level
I assume it doesn’t matter if it is .Panel or .panel?

.panel or .Panel, Go for .panel ;p


yml or yaml

go for yaml for your bundle.yaml file

1 Like

Hi @Jean-Marc

I have changed them and removed it from my revit completely and added back in fresh and still no luck

the yaml format is a very sensible one (at least in pyrevit)
you need to respect the spacing of things
I suggest you run it through this tool https://www.yamllint.com/

in pseudo code:

2 spaces, a dash, 1 space, your panel name
2 spaces, a dash, 1 space, your panel name
2 spaces, a dash, 1 space, your panel name

1 Like

@Jean-Marc thank you, that is now working for organising my panels!

if i then have pushbuttons inside of the panel files and i am trying to organise them it does not appear to be working in the same way?

apologise if there is a website etc for this sort of stuff

It does work the same so it is either a typo, a syntax error, or you did not restart Revit

The documentation of these features is here Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.

i have had to do a bit of a workaround as it does not seem to like ordering “Create” then “Category” so i have changed “Category” to “Category To” and now it works fine

thank you for all your help @Jean-Marc

1 Like

There is a spacebar behind “layout:” and “Create”.
Delete it and it works.

It´s easier to see if the red marked is on:

1 Like

and even better if you use a code editor! ;p

at the beginning, the yaml syntax got me debugging for hours, then I discovered some websites like https://www.yamllint.com/, and code editor extensions that helped with yaml specific syntax

1 Like

This is great! Thanks @Jean-Marc & @Manuel486
Your posts helped me fix my .yaml’s too.

1 Like