@@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?
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?
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.
hi Gavin, I would like to export family parameters as shared parameters. This is done using the export option in the family editor. I dont see any methods for this available from family manager. Can you please help? THank you
Yes you can find a copy of the excel library I use here: github.com/aussieBIMguru/pyrevit/blob/main/ABG_230521_pyRevitParameters.zip Noting it doesn't work in Revit 2025+ due to the change to netcore. For this I've since shifted to using xlrd and xlswriter libraries which ship with pyRevit.
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.
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
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.
@@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.
@@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 ?
@@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.
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.
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.
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?
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
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.
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
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.
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.
You're welcome!
Excellent presentation. Learning from you is a real pleasure.
Thanks, and glad to hear 😀
This is a very detailed explanation! Appreciate this a lot for sharing with the world
Glad it was helpful!
@@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?
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?
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.
Bingo ! Thanks a lot dear
Youre welcome!
Hi! First, thanks for sharing. I don't find the file on GitHub, do you know why? Or did you delete it? :) Thanks again
Youll find my pyrevit tools here:
github.com/aussieBIMguru/pyrevit
hi Gavin, I would like to export family parameters as shared parameters. This is done using the export option in the family editor. I dont see any methods for this available from family manager. Can you please help? THank you
oh I see your video covers how to export/import the data. I think this is what I was hoping to find. THanks
By the way, is your module for the excel export/import avaiable in your github? thanks again
Yes you can find a copy of the excel library I use here:
github.com/aussieBIMguru/pyrevit/blob/main/ABG_230521_pyRevitParameters.zip
Noting it doesn't work in Revit 2025+ due to the change to netcore. For this I've since shifted to using xlrd and xlswriter libraries which ship with pyRevit.
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.
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
Wondering how you would set the parameter formula to 0=0 or 0=1 for Yes/No parameters.
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.
@@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.
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 = "")?
NVM, I think watching this if you give it nothing it would be fine.
@@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.
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.
I what to put a link to 'changes of revit api' but yt don't like me so no link
Thanks! Yes its a pretty big change to the workflow/class.
@@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 ?
@@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.
@@AussieBIMGuru toughy that to but all parameters still appear so Im confuse about it.
Thank you for your work! Is there a way to rename shared parameters (the ones that have similar GUID) using pyrevit?
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.
I've gotten to the point where we print(dat) around 41 min and when I run the script Revit just hangs.
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.
@@facelessone86 not a problem, glad you solved it!
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?
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.
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
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.
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
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.
Pleas next time zoom the code, a little bit.
Yes code zoom aspect is challenging as zooming too close makes the lines not fit on screen. Will do my best in future...