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: 

how to retrieve shared parameter values?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
markjvlampad
4611 Views, 4 Replies

how to retrieve shared parameter values?

here is my situation:

 

I already created my shared parameters and using api I want to retrieve the string values.

 

anyone can help?

 

thanks a lot.

4 REPLIES 4
Message 2 of 5
aignatovich
in reply to: markjvlampad

Hi!

Find your parameter guid, then get parameter from element via: parameter = element.get_Parameter(new Guid("your guid value")), then you can get its value using AsString() method, if your parameter is text or AsValueString() in other cases.

Message 3 of 5
markjvlampad
in reply to: aignatovich

thank you. yup I get it.

 

another issue, can I set the values of shared parameter using the code below?

 

Parameter p = elem.get_Parameter(new Guid("guid"));
String xyz = p.SetValueString("myvalue").ToString();

Message 4 of 5
o.petrashev
in reply to: aignatovich

Sasha hello.

Tell me please. In R2020.1, the get_Parameter (GUID) method no longer works as before?
I have a family loaded in the project, the family has a type parameter. If I read the instance parameter, it used to return null to me. I cited FamilySymbol and read the type parameter.
And now it returns 0 instead of null.

Message 5 of 5

hi @aignatovich ,

would you mind taking a look at this: https://forums.autodesk.com/t5/revit-api-forum/how-to-read-the-value-of-a-family-instance-sharedpara...

 

I am trying to use the method you described below to read a Shared-parameter in a family instance.

 

I am able to get it and set it, but i am not able to read its value within the api.  I can see that i was able to write to it in the UI, but cannot test/read its value in the api.

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

Post to forums  

Forma Design Contest


Rail Community