Can a bundle contain 2 yaml files?

I am trying to simplify my office’s future workload for maintenance with some tools I’ve developed specifically in case I ever leave my office for greener pastures.

I want to keep my code as separate from anything they will have to update in the future so I have a yaml file called “release_year_bundle.yaml” that only contains the min_revit_version and max_revit_version values. My current method limits my yaml file to just the release year data and then having to code the other info into my script.

I would like to keep this bundle file this simple so that:

  1. It makes updating the release year as simple as updating 1 file and coping it to all the other folders
  2. It keeps the all the other code safe while they update this every year

Is there a way to have 2 yaml files?

I’ve tried:
• Making 2 yaml files (Didn’t read the second yaml file)
• importing a file with the correct values (Throws an ‘string mangled’ error on Revit loading that is unsightly but otherwise seems to work)

:grinning_face_with_smiling_eyes: :arrow_forward::evergreen_tree: :sheep:

not sure I understood the general idea:

  • you want to keep adding stuff while keeping the code base intact? ( separate bundle per year maybe? installing separate extensions per year. fairly easy with pyrevit cli)

Thanks for responding @Jean-Marc!

I’m looking at the pyrevit CLI docs now but not sure I’m seeing what I need. I thought Revit automatically uses the old pyrevit settings and extensions when installed so I’m not sure what the update function is for exactly. I definitely should learn to use that tool though!

Essentially I want a yaml file with the min and max Revit years and then a yaml file for title, tooltip, author, ect. The second yaml file should never change. The first can be changed without opening any of the other code files related to the tool.

My final thought is implementing a script that will find all the yaml files I need to update and to automatically change the max (or min) Revit year and then give it a quick UI so that my coworkers can run it

Hi @pnumbers ,
Not sure I would approach the issue like you do.
I would rather create separate different extensions per revit versions.
you know you can have a main extension under one tab and then add another extension with buttons under the same tab.
you could have:

  • main extension with all non revit version specific tools
  • one extension per revit version for version specific tools

with pyrevit cli, you can attach extensions based on the version of revit.
when using CLI, you can pyrevit env
that will list you extensions and revit versions as well as extension attachment to versions
from there, the command goes like this

C:\Users\Jean-Marc>pyrevit attach --help
Attach pyRevit clone to installed Revit
    pyrevit attach (-h | --help)
    pyrevit attach <clone_name> (default | <engine_version>) (<revit_year> | --installed | --attached) [--allusers] [--log=<log_file>]

    Arguments & Options:
        <clone_name>             Name of target clone
        <revit_year>             Revit version year e.g. 2019
        <engine_version>         Engine version to be used e.g. 277
        latest                   Use latest engine
        dynamosafe               Use latest engine that is compatible with DynamoBIM
        --installed              All installed Revits
        --attached               All currently attached Revits
        --allusers               Attach for all users

I hope this helps

Thanks @Jean-Marc. Looks like that will be the best option