Xrev API Tools: Increase Productivity!

Feeds

Loading...
Showing posts with label Formulas. Show all posts
Showing posts with label Formulas. Show all posts

Tuesday, August 13, 2013

Using Temperature Parameters in Formulas

Yesterday I was working on some MEP families and thought I'd do some tricks to generate some formulas to match a manufacturers capacity tables for Total Cooling Capacity & Sensible Cooling Capacity.

Being metric, the Dry Bulb & Wet Bulb Inside temperature parameters I had setup were in degrees Celsius.  The Capacity parameters are in kW's so in order to use the temperature parameters in the formula I would need to remove the units.

Easy, I thought.  I'll just divide by 1°C and that will give me a unitless value.

Unfortunately Revit decided to throw a curve ball at me.  Internally all its calculations are done in Kelvin.  For example, if I use my DB in a formula and its value is set to 20, Revit actually uses 293.15.  So then I thought I'd divide by 1 K... No luck!

After trying for 3 hours I eventually gave up and went to bed.

With a fresh head I did some playing around in Excel to try and figure out how Revit was getting the results it was and eventually I came to this:
Unitless Temperature Parameter


So essentially what Revit is doing here is:

(293.15-272.15) / (546.3/546.3) or 20/1 = 20

Now hopefully someone else doesn't have to go insane trying to figure this out!

Wednesday, August 29, 2012

Revit Formula Rounding

Today I came across a circumstance where I needed to round a value in a family to be to the nearest 5mm increment (+ tolerance).

The Round functions in Revit only round to the nearest whole number.  So a little maths is required to achieve this.

EG:

I have a parameter called "Param1" that I want to drive "Param2" from.

Param2 = (roundup((Param1 + 5 mm) / 5 mm)) * 5 mm

Essentially what we are doing is first adding the tolerance we want, then dividing by 5 (the rounding increment we want), rounding this off to the nearest whole number and the multiplying by 5 again to give us the desired rounded dimension.

Pretty simple, but hopefully someone will find it useful.

Saturday, October 09, 2010

Making a completely parametric mobile crane - Final

Hi Everyone,

Again, sincere apologies for the delay in updates.  Please watch the below 3 videos for the final explanation of how I went about making this family.  Comments always welcome and any recommendations for what people what me to show next.

Cheers.





Monday, May 25, 2009

Conceptual Mass - Defining Area to control width & length automatically

In this quick tutorial I've taken a request from Ry on linkedin to produce a rectangular mass family where you can set the area, then use grips to change the length and width whilst still maintaining the required area.