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: 

Passing 'Angle' value to instance 'Angle parameter type

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
z_malasi
2407 Views, 2 Replies

Passing 'Angle' value to instance 'Angle parameter type

Hi,

I am getting some wierd angle results when I pass an angular value (e.g. 45 degrees) stored in  'Double' variable, and passing it to re-set the 'AngleRot' instance parameter in the family.

As an example, if the the value obtained is 45 degrees then when I pass it to set the 'AngleRot' instance parameter, the family shows 1543.34567...  Some strange value!!

What is teh method for converting the Double value to an Angular value correct in C# to assign it to a Revit instance parameter of 'Angle' type...

Thanks for your help

###### CODE BEGIN  ######
double AngleDbl = 35.5;

param1 = familyinstance.get_Parameter("AngleRot");
param1.Set(AngleDbl);

###### CODE END ######

Zak
2 REPLIES 2
Message 2 of 3
ollikat
in reply to: z_malasi

I think you should give angles as radians for that parameter.

Message 3 of 3
z_malasi
in reply to: ollikat

Hi Olikat,

 

Thanks for your great help. You have saved my day. I have converted the angle value from Degrees to Radians, and then passed the value to the instance parameter. That worked. Here is the line of code modified below.

 

double AngleDbl = 35.5 * Math.PI / 180;

 

Thanks - Zak

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community