Adding parameters to Revit families using pyRevit!

Поділитися
Вставка
  • Опубліковано 15 вер 2024

КОМЕНТАРІ • 40

  • @JavierOropeza08
    @JavierOropeza08 8 місяців тому +1

    You indeed are the guru, thanks for this. I hope to one day actually watch this because I am ready to implement something like this.

  • @piotrchoromanski395
    @piotrchoromanski395 8 місяців тому +1

    Excellent presentation. Learning from you is a real pleasure.

  • @abhishekshinde5378
    @abhishekshinde5378 5 місяців тому +1

    This is a very detailed explanation! Appreciate this a lot for sharing with the world

    • @AussieBIMGuru
      @AussieBIMGuru  5 місяців тому +1

      Glad it was helpful!

    • @abhishekshinde5378
      @abhishekshinde5378 Місяць тому

      @@AussieBIMGuru I tried running the script, it is reporting Missing Parameters in SP file. I used your github code and tested in 2024. Is SP file need to be defined before running this script? Am I missing something?

    • @abhishekshinde5378
      @abhishekshinde5378 Місяць тому

      I was able to resolve this issue by creating an SP File. However, I have Data Validation with Items as a List in my formulas. Revit is not reading it in the formulas. How can I integrate Data Validation(Value List) from Excel to be read inside the Revit Shared Parameters?

    • @AussieBIMGuru
      @AussieBIMGuru  Місяць тому

      Excel generally wont pass on its formulae to revit, but i know some builds this can happen in if using openxml nodes. The only way to get around is copy the values over themselves as values I believe. Might be best asked via the forums to get in depth help.
      One last idea is make sure your formulae are encapsulated by double apostrophes if they are a text value in revit.

  • @ibrahimantonios
    @ibrahimantonios Рік тому +1

    Bingo ! Thanks a lot dear

  • @mariebretaudeau2222
    @mariebretaudeau2222 3 місяці тому +1

    Hi! First, thanks for sharing. I don't find the file on GitHub, do you know why? Or did you delete it? :) Thanks again

    • @AussieBIMGuru
      @AussieBIMGuru  3 місяці тому

      Youll find my pyrevit tools here:
      github.com/aussieBIMguru/pyrevit

  • @rik0904
    @rik0904 Рік тому +1

    for all of you who want to do it in 2024.BuiltInParameterGroup is now a class ForgeTypeId you can find list of them in GroupTypeId class.

    • @rik0904
      @rik0904 Рік тому

      I what to put a link to 'changes of revit api' but yt don't like me so no link

    • @AussieBIMGuru
      @AussieBIMGuru  Рік тому +1

      Thanks! Yes its a pretty big change to the workflow/class.

    • @rik0904
      @rik0904 Рік тому

      @@AussieBIMGuru about shared parameterfile there is a new column caled HIDEWHENNOVALUE(or maybe i just missed it some how for all this years), but it don't seems to do much form me. Did you experiment with it ?

    • @AussieBIMGuru
      @AussieBIMGuru  Рік тому

      @@rik0904 i havent used it before but i believe it hides the parameter at project level if inpopulated in an element. I generally avoid hidden parameters as they confuse users.

    • @rik0904
      @rik0904 Рік тому

      @@AussieBIMGuru toughy that to but all parameters still appear so Im confuse about it.

  • @Jul10CAd
    @Jul10CAd Рік тому +1

    Thank you very much, I have something in my mind from some time, is it possible to turn on/off, make current, change elements between worksets?, I´ve been looking in pyrevit but can't find something, maybe you could help me in the right direction, thanks in advance.

    • @AussieBIMGuru
      @AussieBIMGuru  Рік тому

      Yes you can do most of this using the WorksetTable class (create, rename, turn on/off worksets).
      You can set an elements workset using the builtinparameter ELEM_PARTITION_PARAM, then set that to the Id of the desired workset, see reference here:
      forums.autodesk.com/t5/revit-api-forum/set-element-workset/td-p/7706868

  • @facelessone86
    @facelessone86 Рік тому +1

    If you wanted to put a default value when a formula is not provided but wanted it to be blank would you set it to (....,famForm = "")?

    • @facelessone86
      @facelessone86 Рік тому +1

      NVM, I think watching this if you give it nothing it would be fine.

    • @AussieBIMGuru
      @AussieBIMGuru  Рік тому

      @@facelessone86 indeed you can leave out default value to get blank. It is an optional argument which has a default value of "" in the form method.

  • @facelessone86
    @facelessone86 Рік тому +1

    Wondering how you would set the parameter formula to 0=0 or 0=1 for Yes/No parameters.

    • @facelessone86
      @facelessone86 Рік тому +1

      I made the dummy list a string a string like "0 = 1" and it worked. I'm guessing things we get from excel may need to be turned into strings in some cases.

    • @AussieBIMGuru
      @AussieBIMGuru  Рік тому

      @@facelessone86 yesno values are typically set as Booleans in python but are defined as conditions in revit. So if you fed the formula of 1=1 it would lock it to always true in revit.

  • @facelessone86
    @facelessone86 Рік тому +1

    I've gotten to the point where we print(dat) around 41 min and when I run the script Revit just hangs.

    • @facelessone86
      @facelessone86 Рік тому +1

      NVM, just noticed that the file path had a "." when it should of had a "\". I think I missed it because I placed the file in the scripts folder structure and there are already a bunch of periods in there. Sorry for posting so much, just trying understand all of this as I go.

    • @AussieBIMGuru
      @AussieBIMGuru  Рік тому

      @@facelessone86 not a problem, glad you solved it!

  • @orans8108
    @orans8108 10 місяців тому

    Im getting: Not found in shared parameters file:... and then None like a couple of times. Tested it with many shared parameters. Any idea what im doing wrong?

    • @AussieBIMGuru
      @AussieBIMGuru  10 місяців тому

      Sounds like you're either not connected to the shared parameters file or it's not in there by matching name. Case sensitivity etc. is important.

    • @orans8108
      @orans8108 10 місяців тому

      How to connect to te shared parameter file? When i open my family i can set shared parameters through my shared parameter file. Im using revit 2023 btw.@@AussieBIMGuru

    • @facelessone86
      @facelessone86 6 місяців тому

      This may be that it is ready rows that appear to be empty in Excel. I have only two rows but it is reading three. The third returns 'None' when I print the target_params. There may be a way in excel to make them truly empty, but I think I'm just going to add something to remove rows where target_Params == None.

  • @debaron270602
    @debaron270602 Рік тому

    Thank you for your work! Is there a way to rename shared parameters (the ones that have similar GUID) using pyrevit?

    • @AussieBIMGuru
      @AussieBIMGuru  Рік тому +1

      Not technically. I have a video in dynamo where I show how to replace a shared parameter however in families. Generally it is best to avoid renaming parameters unless you give them a new guid as they wont play well together in a project and wont be able to coexist in families in old/new form.

  • @pawlak0007
    @pawlak0007 Рік тому

    Pleas next time zoom the code, a little bit.

    • @AussieBIMGuru
      @AussieBIMGuru  Рік тому

      Yes code zoom aspect is challenging as zooming too close makes the lines not fit on screen. Will do my best in future...

  • @AndreaGhensi
    @AndreaGhensi 10 місяців тому

    Let me guess, did you learn python using dynamo? Do you know that there's more than lists in python? Your code would be much simpler if you use dictionaries to aggregate the info of a parameter (an excel row) Also, pyrevit ships with xlrd that lets you read excel files without the need to have Excel installed, a Transaction class that can be used as context manager (with Transaction(): ...) and the open_doc function as handy wrappers to the revit API

    • @AussieBIMGuru
      @AussieBIMGuru  10 місяців тому +1

      I did originally and am learning C at the moment. Whilst I'm aware of dictionaries and use them from time to time I prefer to manage lists for more legible code but I appreciate in this case they likely could have made for simpler code. I'm much less familiar with them though so I'm definitely biased due to my experience haha...
      I've used xlrd in pyrevit more recently in learning it, thanks for the tips though! These days I use the with transaction statement generally, although I sometimes use dynamo friendly code that depends less on pyrevit with this workflow as I tend to do some family work in Dynamo also.