Setting Revit Units

Setting Revit Units

ahmadkhalaf7892
Advocate Advocate
356 Views
3 Replies
Message 1 of 4

Setting Revit Units

ahmadkhalaf7892
Advocate
Advocate

Hi Revit Developers, I wanted to ask how Can I set the units in Revit C# into meters, Whenever I use a double(number) value it automatically uses the double values as Feet. For example, I have set the units to Meters in Revit before using my add. in. And I have used 10 as a double value to create an offset, however, the offset value is 3.048 (meters) which is 10 Feet. 
take this code for example:
Curve curves2 = curve1.CreateOffset(10, new XYZ(0, 0, 1));       the 10 value here is automatically changed into feet
How can I make the C# use the selected unit in Revit (in this case meters)?

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

moturi.magati.george
Autodesk
Autodesk
Accepted solution

Hi @ahmadkhalaf7892,

 

Based on multiple discussions on this forum and blogs from Autodesk and thebuildingcoder, internally, Revit always uses imperial feet for all length/ distance related units and you can only convert them to desired units for the presentation purposes only.

 

Have a look at the Revit documentaion below:

https://help.autodesk.com/view/RVT/2023/ENU/?guid=Revit_API_Revit_API_Developers_Guide_Introduction_...

 

 

You can also have a look at the similar discussions below:

https://forums.autodesk.com/t5/revit-api-forum/units-system-in-document/td-p/7670881

 

https://forums.autodesk.com/t5/revit-api-forum/determine-the-project-units-metric-or-standard/td-p/4...

  Moturi George,     Developer Advocacy and Support,  ADN Open
0 Likes
Message 3 of 4

ahmadkhalaf7892
Advocate
Advocate

Hi @moturi.magati.george 

Thanks for the answer, so basically I cannot change the unit, I have to  change them from feet to meters by calculations?

but what if I am importing points into Revit , will I also have to change them via calculations?

0 Likes
Message 4 of 4

moturi.magati.george
Autodesk
Autodesk

Based on the documentation shared above, the points will be imported to Revit with the Imperial system i.e. feet. If you want to display them using meters you will also have to convert them for that purpose.

  Moturi George,     Developer Advocacy and Support,  ADN Open
0 Likes