how to retrieve shared parameter values?

how to retrieve shared parameter values?

markjvlampad
Advocate Advocate
5,614 Views
4 Replies
Message 1 of 5

how to retrieve shared parameter values?

markjvlampad
Advocate
Advocate

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.

0 Likes
Accepted solutions (1)
5,615 Views
4 Replies
Replies (4)
Message 2 of 5

aignatovich
Advisor
Advisor
Accepted solution

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
Advocate
Advocate

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();

0 Likes
Message 4 of 5

o.petrashev
Advocate
Advocate

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.

0 Likes
Message 5 of 5

fawzimasri7137
Advocate
Advocate

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.

0 Likes