How to get Angle parameter from FamilyInstance

How to get Angle parameter from FamilyInstance

kireandreev
Contributor Contributor
1,566 Views
3 Replies
Message 1 of 4

How to get Angle parameter from FamilyInstance

kireandreev
Contributor
Contributor

Dear,

 

I would like to ask how to get Angle parameter from FamilyInstance? 

I try with:

var angle=e.LookupParameter("Size").AsString(); retrieve value null,  but Angle in Revit Properties->Dimensions is 90 degree.

 

Best Regard.

0 Likes
Accepted solutions (1)
1,567 Views
3 Replies
Replies (3)
Message 2 of 4

architect.bim
Collaborator
Collaborator
Accepted solution

Hi!

What do you mean by "Angle" parameter. What category does your family instance belong to?

If parameter's name is "Angle" why do you use name "Size" to retrieve it? Furthermore is your parameter's StorageType is really string?

 

I think you should do the following:

  1. Select necessary element;
  2. inspect it through RevitLookup;
  3. go to "Parameters" property;
  4. select necessary parameter;
  5. check its StorageType;
  6. choose appropriate method to get its value.

 

After this use parameter's name and chosen method to get ist value.


Maxim Stepannikov | Architect, BIM Manager, Instructor
0 Likes
Message 3 of 4

kireandreev
Contributor
Contributor

Dear,

 

This is my error. var angle=e.LookupParameter("Size").AsString(); must to be

 var angle=e.LookupParameter("Angle").AsString();

I would like to get value of Angle like in picture below: 

 
 

Angle.png

 

 

Best regard.

0 Likes
Message 4 of 4

architect.bim
Collaborator
Collaborator

Oh I see... The StorageType of this parameter is Double. You should use AsDouble() method to get its value. This value is in internal Revit Units - Radians. If you need decimal degrees - you should convert it.

On the other hand if you need to get exact representation of this parameter's value as you see in Revit UI, you can use AsValueString() method. It will return string "90.00°"

210109_1512_009.jpg


Maxim Stepannikov | Architect, BIM Manager, Instructor
0 Likes