Reputation: 13
I am working at revit api to get walls of special room this is the part i have completed with Projecting rays technique. This is the main point that i am unable to do Wall thickness. Is there any way i can extract wall thickness. i am using revit 2020. Thank you
Upvotes: 0
Views: 2068
Reputation: 76
You can only get the wall width via the WallType of the wall.
On top of that, Revit will give you the width in its native unit (usually the imperial system). It is possible to convert it easily with the UnitUtils class. Documentation here
The first step is to get the WallType. To do that, you have to retrieve the type ElementId via GetTypeId(), then the element via document.GetElement(), and finally cast it to WallType.
From the type, we obtain the width in Revit native units, which we convert into milimeters via the UnitUnits class.
Here is a code snippet:
WallType wallType = document.GetElement(wall.GetTypeId()) as WallType;
double nativeWitdh = wallType.Width;
double milimeterWidth = UnitUtils.ConvertFromInternalUnits(nativeWitdh,DisplayUnitType.DUT_MILLIMETERS);
Best regards, François
Upvotes: 1
Reputation: 8339
Sure, very easy.
Use the WallType
Width
property.
You could very easily have answered this question by yourself, either by searching the Internet or by exploring the wall and its properties using RevitLookup.
Please perform some minimal research for yourself before asking a question and making others do the work for you.
Here is some more advice on researching how to solve a Revit API programming task.
Upvotes: 0