Which function should I use when I need to get the area of an element?

Which function should I use when I need to get the area of an element?

Anonymous
Not applicable
591 Views
3 Replies
Message 1 of 4

Which function should I use when I need to get the area of an element?

Anonymous
Not applicable

Which function should I use when I need to get the area of an element?

 

For example, I know how to get the category or element id of an element,

just simply type elem.Category.Name, then I can get it.

 

But now i need to get the area of a floor,

which function should I use?

 

Thanks a lot!

0 Likes
592 Views
3 Replies
Replies (3)
Message 2 of 4

saikat
Autodesk
Autodesk

Hi:

 

The area of a floor is stored in the parameters. Using the API, you can access the area information from a floor by extracting the specific Area parameter. YOu can do this either by using the string "Area" as the parameter name or use BuiltIn parameters and in this case you will have to use the built-in parameter called Host_Area_Computed. For more on how to work with parameters, please take a look at the SDK samples contained in the Revit installation folder.

 

Usually for any query like this, please make use of the Revit Snoop tool called Revit LookUp. This is also part of the Revit SDK. Using this, you can access all the information on any Revit element without even writing a single line of code. I am attaching a screenshot of how the LookUp tool looks like and how I got the information I have just provided using this tool.

 

Anotther great resource for API related queries in The Building Coder blog by Jeremy Tammik.

 

cheers

Saikat



Saikat Bhattacharya
Senior Manager - Technology Consulting
0 Likes
Message 3 of 4

Anonymous
Not applicable

 

Ok, thanks a lot. I've found the related SDK example!

0 Likes
Message 4 of 4

saikat
Autodesk
Autodesk

Great. All the best for your programming endeavors with Revit API.

 

Saikat



Saikat Bhattacharya
Senior Manager - Technology Consulting
0 Likes