CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 2811 

CAD tip CAD tip # 7714:

Question CAD 
 %  platform  category 
Q - question

Magic number for Revit (metric).

A - answer If you program a macro or an add-on module for Revit, using either the integrated VSTA environment, or on of the Visual Studio .Net programming languages, sooner or later you will need a "magic" constant to multiply the size units.

Revit uses feet as internal units in its BIM database. You don't neccessarily see these units in the Revit UI as a user (if you use the metric settings) but you definitely need them as a programmer - and convert the internal values in some API functions. For these conversions you may need two constants:

Const MeterToFeet As Double = 3.2808399
Const FeetToMeter As Double = 0.3048
or - in millimeters:
Const MmToFeet As Double = 0.0032808399
Const FeetToMm As Double = 304.8
100% *  CAD 
7.1.2011    5640×  
Prices - CAD eShop:
applies to: Revit ·

See also:
Tip 12777:Arithmetic and trigonometric functions available in Revit expressions.
Tip 12624:How to enter dimensions in Revit using other units?
Tip 12609:Dynamo - how to convert a raster photo to 3D model in Revit?
Tip 11494:Entering decimal values using fractions in CAD applications.
Tip 10192:Wrong results when adding or subtracting °C temperatures in Revit.

Back   All CAD Tips All CAD tips&tricks

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   

Extend your AutoCAD LT productivity with our popular add-on
CADstudio LT Extension More info

Please use these tips at your own risk.
CAD Studio is not responsible for possible problems that may occur as a result of using any of these tips.