Different (roof) slope values on same element?

<span lang=“EN-US”>I have a Revit project with a simple roof element with two sloped planes (see picture). I’m trying to get the slope value of the roof element so I can use this to perform some calculations, but I ran into some (probably small) issues. </span>

<span lang=“EN-US”>The slope value in this case is 42 degrees. The Element.GetParameterValueByName node however reports a value of 51.584. This probably is a conversion of some sort, but I just can’t figure out where this value comes from, I was hoping someone could explain this to me. </span>

<span lang=“EN-US”>Second question, the LunchBox Get Parameter Value node does report the correct value, however this nodes outputs this in a string (including the degree sign, the small circle) how can I convert this into a float? </span>

<span lang=“EN-US”>Many thanks in advance!</span>

slope question

For readability purposes hopefully this time without the span tags…

I have a Revit project with a simple roof element with two sloped planes (see picture). I’m trying to get the slope value of the roof element so I can use this to perform some calculations, but I ran into some (probably small) issues.

The slope value in this case is 42 degrees. The Element.GetParameterValueByName node however reports a value of 51.584. This probably is a conversion of some sort, but I just can’t figure out where this value comes from, I was hoping someone could explain this to me.

Second question, the LunchBox Get Parameter Value node does report the correct value, however this nodes outputs this in a string (including the degree sign, the small circle) how can I convert this into a float?

Many thanks in advance!

slope question

Hi Rob,

I not sure of your first question. But for your second question i have answer below. Hope it helps!

Good Luck!

 

Untitled

Thanks for your response Kulkul,

It looks like the String.RemoveAfterGivenCharacter node will do the trick! However I can’t find this node in my library, is it part of a package?

To rephrase my first question, the Element.GetParameterValueByName node outputs a slope value of 51.584 instead of 42 degrees, but why? When I change the slope of the roof element in Revit manualy the node always outputs a different value. It seems like the value somehow gets converted, I’m trying to figure out what this conversion is.

You can find it in John Pierson’s “Rhythm Package”. You can search for a package under packages in Dynamo.

Good Luck!

Thanks Kulkul, got it to work!

In the meantime I found the answer to my first question with the help of this post: http://thebuildingcoder.typepad.com/blog/2010/08/slope-is-slope-not-radians.html I’ll try to explain it for those of you who are interested.

I noticed that for some reason when you’re trying to get the slope parameter value of a roof element you don’t get the correct value. When you manualy set the slope value to a certain value (lets say 45 degrees) the Element.GetParameterValueByName will give you a different value (in this case 57.296 instead of 45). The 45 degree value indeed gets converted a long the way, this is what’s going on:

The 45 degree slope value is stored inside of Revit as an incline value (don’t know if this is the correct English word) which is “the relation between the horizontal and vertical components of the corresponding vector” as Jeremy Tammik puts it. To calculate this value you have to use Math.Tan(45) which equals 1. This value then is interpreted as if it is a radian, so its gets converted from radian to degrees like this: degrees = (radian/pi)*180 which then gives you the value of 57.296.

So for the other way around, when you want to use Dynamo to set the slope value of the roof element you should use something like this.

set slope

1 Like

An old thread, but worth a punt.

I have tried to reverse engineer the above to obtain the roof slope in degrees of any selected roof element.

However it is throwing out some inconsistencies (unless I’m missing something obvious).

The slope being reported in Dynamo does not translate correctly back to degrees. The attached screenshot is from a 45 degree sloped roof (as defined in Revit Slope parameter).

Can anyone shed some light on why this is happening, or on my stupidity?

Thanks in advance.

 

Hi Joe,

Try changing these settings in Dynamo:

I just noticed the same. It may be due to latest Dynamo 1.0. You can also look at Math.Round nodes.

Hi Kulkul,

Thanks for the response and confirming it isn’t just me.

It is quite strange behaviour, I can’t imagine where the discrepancy within Revit’s conversion is happening.

Agree that rounding is the best solution that can be used at this time - I’m only extracting for Gutter and RWP size calculation so I have a hefty tolerance within the Building Regs ranges.

As a side note: The rounding solution prompted me to think that the issue could be related to project units in revit and some form of rounding occurring when the slope input of degrees is converted to a slope. Tried increasing the decimals in project units. No joy. Baffled.

Thanks for your help.

It doesn’t seem to be an issue within dynamo code. All the equations stack up when I use a calculator (took me back to my GCSE’s all those years ago). I can only assume that is an issue with the slope being reported by Revit.