Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[bug] FamilyManager.ReplaceParameter(), UserModifiable not updated

11 REPLIES 11
Reply
Message 1 of 12
Anonymous
1088 Views, 11 Replies

[bug] FamilyManager.ReplaceParameter(), UserModifiable not updated

When using ReplaceParameter with a new Definition that has UserModifiable set to 0, the parameter is not updated for that property and the user can still modify it.

 

I have to remove the parameter first and than recreate it to have UserModifiable 0.

11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: Anonymous

bump

Message 3 of 12
jeremytammik
in reply to: Anonymous

Dear Michal,

 

Thank you for your report.

 

I logged the issue REVIT-108089 [Using FamilyManager.ReplaceParameter with UserModifiable has no effect -- 12640559] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.

 

You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 4 of 12
Anonymous
in reply to: jeremytammik

Some additional info is that the parameters are being replaced in a FamilyDocument and they are SharedParameters.

Message 5 of 12
jeremytammik
in reply to: Anonymous

Dear Michal,

 

Thank you for your update and additional info.

 

I added it to the issue REVIT-108089 [Using FamilyManager.ReplaceParameter with UserModifiable has no effect -- 12640559].

 

They will probably ask for a reproducible case:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

Can you please provide one?

 

You last comment just proved how important it is.

 

There are always things left unsaid and possibilities for misunderstanding.

 

Thank you!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 6 of 12
jeremytammik
in reply to: Anonymous

Dear Michal,

 

Thank you for your patience.

 

The development team took a look at the issue REVIT-108089 [Using FamilyManager.ReplaceParameter with UserModifiable has no effect -- 12640559] that I raised on your behalf and say:

 

The method FamilyManager::ReplaceParameter does not have a parameter named UserModifiable. From what I see in the code, it looks like Shared Parameters have a property named UserModifiable - they are probably referring to that. Still, the FamilyManager itself is agnostic of all that. Families, by themselves, don't care much about user-editability or not - it is probably down to the parameter/UI to do it right.

 

Also, looking at the UI - this UserModifiable property ... it is not accessible through the Revit UI.

 

Please provide a reproducible case in C# or Python that can be placed in to a macro so we can see this thing happening. Thanks!

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

Can you please provide one, so they can continue investigating and understand better exactly what is going on?

 

Thank you!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 7 of 12
Anonymous
in reply to: jeremytammik

The method itself does not have that parameter. But the Definition we give to the method does. The UI does not have this because it is a property of a shared parameter.

 

Message 8 of 12
jeremytammik
in reply to: Anonymous

Dear Michal,

 

Thank you for your update.

 

These are typical examples of basic facts that are obvious to external Revit API add-in developers and Revit end users, and not necessarily to internal developers buried deep in some code somewhere.

 

That is why a reproducible case is so important to clarify exactly what the issue is, and enable them to easily explore it without the need for further explanations and clarifications.

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 9 of 12
Anonymous
in reply to: jeremytammik

I will try to create a case today

Message 10 of 12
srvcforge
in reply to: jeremytammik

Hello Jeremy.
I have the same problem and don't see how I can get Revit 2021 to respond and update the parameter.


The objective is to promptly allow the user to edit the shared parameters in a family (RFA) that were initially locked and then do the opposite operation to leave all the shared parameters locked again.

 

I put the code that I am using. It does not give any error, but neither does it update the shared parameters making them available to the user.

Message 11 of 12
jeremytammik
in reply to: srvcforge

Sorry to hear of your problem. 

 

Please provide a complete minimal reproducible case, including the model (if required), family definition (if required) and macro to enable the development team to analyse the issue (and prove that it really exists, and that your coding is correct):

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 12 of 12
RvdScheur
in reply to: jeremytammik

Hello @jeremytammik @srvcforge ,

 

I'm running into a similar issue on project parameter level. In this case we add shared parameters UserModifiable FALSE. The idea is to have a toggle button that sets the UserModifiable to TRUE so users can manually edit if necessary. 

 

The 'Testknop' currently does 4 transactions:

- Save elementdata for shared parameters

- Save & delete project parameter data (names/types)

- Re-add the projectparameters (using ExternalDefinitionCreationOptions) -> usermodifiable changes True/False by clicking the button)

- Re-adding the data to all elements

 

The workflow works appart from parameters still not being editable. 

 

Debugging:

- I checked the temp sharedparameter file, which had a 1 as usermodifiable

- I'm logging all parameters created, which state UserModifiable as true.

- I retraced all transaction steps and cant find old parameter data in the element or in the document

 

 

Reproducible Test Case

- There is a Revit file attached. 

- For debugging please run the open-source plugin, here's a link to the current branch:
https://github.com/buildingsmart-community/bSDD-Revit-plugin/tree/toggle-usermodifiable

- Video of steps used is added. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report