How to make a non-editable parameters

Helo Forum,

I have a simple question: Would it be possible to make a (project or shared) parameter non-editable after filling in some values like (text, integer, etc)

Any response would be appreciated.

Thank you in advance

Regards,

Rasa



@shahrasa , hi

you can lock them via formulars in .rvt or .rfa filesā€¦ with Dynamo i have no knowingā€¦

1 Like

Hi Draxl,

Thank you for you reply. This can still be editable. I was wondering if it would be possible through the Revit API to lock a parameter and (maybe) show it as ā€œread onlyā€, while it was originally editableā€¦

1 Like

i had already a similar issueā€¦ but nobody had an idea @shahrasa

creating Parameters takes filespaceā€¦ when you lock unique values, it can result in performance leak.

thatā€™s weird, wouldnā€™t you agree? and you did not get any answer to you question: ā€œIs there a way to lock a parameterā€. I am not trying to lock unique valuesā€¦ the goal can be:

  1. to lock parameters so they cant be filled in until it is unlocked (by me for example) (like PINED & UNPINNED)
  2. locking parameters so the values cant be changedā€¦(example: while sharing the revit model, we dont want the advisors to be able to modify parameter values)
  3. Integrade parameters into families and project with company name, so it cant be reused or changed by othersā€¦

@shahrasa ,

a other way that w role out: using keyschedules so Parameters get filled by elected valuesā€¦
But it can`t lockedā€¦ you can be a owner of a worksetā€¦

Hi Guys, @jacob.small @Nick_Boyts @GavinCrump @solamour

Sorry for involving you. I learned a lot from you, so I think that you guys can answer my questionā€¦

@Draxl_Andreas thanks mate, but I am certain it is possible through Revit APIā€¦

Hi @shahrasa ,

Is there a way this could even be done through Revit? So without using Dynamo?
This isnā€™t really a Dynamo question.

Hi @Daan,

No, I guess this is not a Dynamo question. But it can be a Revit API question? and the only way I can access Revit API is through Dynamo. If it is not possible, then it is not possibleā€¦ Anyway tnx for the response

I think you would get a better answer when asking the same question on a Revit forum.
Also you can access the Revit API in a lot of different ways, Dynamo is just one of them.

Doable via Dynamo accessing the RevitAPI (which is what Dynamo does anytime it interacts with Revit).

That said, I am not a fan of the workflow as it usually (literally like 99% of the time) leads to more headaches then it ever solves for both downstream BIM uses and in-house coordination purposes (I canā€™t edit this thing and itā€™s wrong!).

What is the specific use case you have in mind?

EDIT: Just saw the use cases aboveā€¦

  1. You (as a user) canā€™t unlock them, but the add-in which created them can. Itā€™s super messy as a result because a slight change in your add-in means your data is ā€œcast in stoneā€ and can only be cleaned out by rebuilding everything, in some cases Iā€™ve had to tell firms theyā€™ll have to live with it as is, restore to a backup, or scrap entire family libraries.
  2. Every firm says they want this until it happens to them and they have to spend a few unpaid weeks fixing someone elseā€™s stuff. Track the modifications instead via modern collaboration tools (ie: BIM360 Design).
  3. Again, this gets to the question of ā€œhow much are you willing to throw away in 4 years when you re-brand the office to be ā€œDoolittle & Dailyā€ instead of ā€œDoolittle + Dailyā€? If not everythingā€¦ donā€™t lock it down that tight.

If youā€™re still interested, Iā€™ll see about putting a tutorial together, but youā€™ll have to watch it and write the code from that. Itā€™ll be a learning exercise for you that will allow you to progress, and Iā€™ll get the piece of mind that youā€™ll be competent enough to ā€˜fix itā€™ in the future when it is inevitably required.

2 Likes

Hi Jacob,

Thanks for you plain explanation. I am still very interested. I always want to learn and this is a great learning opportunity. I can a little bit of Python and through tutorials and research that knowledge is getting bigger :slight_smile:

PS. I can run the add-in after detaching the model and share itā€¦:wink: that way the information wonā€™t be casted in stoneā€¦ right?

With kind regard,

Rasa

+1 to Jacobā€™s post.

Train/trust your users.

If you must lock it in, use something like the property wizard add-in, donā€™t delve into dark art code that will no doubt cause problems if the evil wizard who implemented it turns out not to be so bus proof.

If you donā€™t want other people modifying your model then just send them for information only, itā€™s a legal thing ultimately versus ā€˜I want to protect our firms cool stuffā€™. The idea of read-onlyā€™ing Revit files is a dead end in my experience - donā€™t bother protecting them any more than purging what you donā€™t need to transfer.

The best way to lock your data in is to prefix your parameters that are crucial. For example make the name of your copyright parameter the actual copyright notice. If people remove it, oh well. They probably wont have the system to integrate it into anyway.

1 Like

And now I think Iā€™ll need a different hat than usual for this recordingā€¦

No. This has to be set when the parameter is created; there is no ā€˜lock it after the factā€™. This will also mean that the methods you use for element creation will be limited in that context as well. Once the value is provided, there is no going back without using an API method to adjust it. Users are literally handcuffed for values. Copying, duplicating, create similar and grouping elements can all become a bit problematic as a result.

Time wiseā€¦ this is going to have to wait a bit. I have some stuff to present at BiLT NA which will have to be wrapped up first (so much stuff being built for that itā€™s scary). If you havenā€™t seen something from me by the 22nd of next month, please reach out. In the meantime, brush up on your Python skills, then the Revit API. Pay close attention to Revit parameters class and extensible storage class, as those are the two things Iā€™ll likely be touching on.

2 Likes

@GavinCrump Thank you for the advise. I also see a lot of handy use cases as to help the users. I think, it is important for me to understand what the possibilities are and in which way I can implement these possibilities in our workflow. Therefor, I am very interested in understanding this topic. :pray:
@jacob.small Thank you as wel and I will send a reminder.

Hello all,

This topic is a bit diluted for me due to busyness. Lately, I searched a lot on the internet, but I couldnā€™t find anything. Can anyone push me in the right direction? such as ā€˜classesā€™, ā€˜modulesā€™, ā€˜methodsā€™ in revit API? Very much appreciated.

With kind regards,

Rasa