Revit API

Reply
Active Member
stcw
Posts: 7
Registered: ‎09-27-2011
Message 1 of 4 (250 Views)

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

250 Views, 3 Replies
09-29-2011 06:30 PM

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!

Employee
saikat
Posts: 185
Registered: ‎08-16-2007
Message 2 of 4 (231 Views)

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

09-30-2011 11:02 AM in reply to: stcw

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

Active Member
stcw
Posts: 7
Registered: ‎09-27-2011
Message 3 of 4 (211 Views)

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

10-03-2011 02:06 AM in reply to: stcw

 

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

Employee
saikat
Posts: 185
Registered: ‎08-16-2007
Message 4 of 4 (207 Views)

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

10-03-2011 08:11 AM in reply to: stcw

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

 

Saikat



Saikat Bhattacharya

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.