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: 

Set a value for Shared parameter

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
antonFFF2V
287 Views, 2 Replies

Set a value for Shared parameter

antonFFF2V
Participant
Participant

Hello everyone. I don't have much experience with Revit API, so I confused with parameters.
In our project we have shared parameter (type - Length) for structural framing which we use to get absolute elevation in Tags.

This parameter also is a parameter of type in family of structural framing.
I wanted to set the value of this shared parameter in type with LookUp, but I've understood that it doesn't work.
Please help or give advice, how can I get and set shared parameter of type?

0 Likes

Set a value for Shared parameter

Hello everyone. I don't have much experience with Revit API, so I confused with parameters.
In our project we have shared parameter (type - Length) for structural framing which we use to get absolute elevation in Tags.

This parameter also is a parameter of type in family of structural framing.
I wanted to set the value of this shared parameter in type with LookUp, but I've understood that it doesn't work.
Please help or give advice, how can I get and set shared parameter of type?

Labels (2)
2 REPLIES 2
Message 2 of 3
antoine_ferron
in reply to: antonFFF2V

antoine_ferron
Explorer
Explorer
Accepted solution

Hi,
You have to retrieve the FamilySymbol of your familyInstance to get and set a parameter of type look at the code below :

 

 FamilySymbol familySymbol = familyInstance.Symbol;  //familyInstance is one instance of your Structural Framing
            
            using (Transaction ts = new Transaction(doc, "Change value of parameter"))
            {
                ts.Start();
                familySymbol.LookupParameter("NameOfYourParameter").Set(TheNewValue);
                ts.Commit();
            }

 

Hi,
You have to retrieve the FamilySymbol of your familyInstance to get and set a parameter of type look at the code below :

 

 FamilySymbol familySymbol = familyInstance.Symbol;  //familyInstance is one instance of your Structural Framing
            
            using (Transaction ts = new Transaction(doc, "Change value of parameter"))
            {
                ts.Start();
                familySymbol.LookupParameter("NameOfYourParameter").Set(TheNewValue);
                ts.Commit();
            }

 

Message 3 of 3
antonFFF2V
in reply to: antoine_ferron

antonFFF2V
Participant
Participant

Thank you, your idea and code helped me

0 Likes

Thank you, your idea and code helped me

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

Post to forums  

Autodesk Design & Make Report