Get IFC Class Name of an element Category

Get IFC Class Name of an element Category

Anonymous
Not applicable
1,656 Views
5 Replies
Message 1 of 6

Get IFC Class Name of an element Category

Anonymous
Not applicable

Hi,

 

I want to get the IFC Class Name of an element category.

I find a method which it can do so. but there is a problem.

this method is:

AutoDesk.Revit.DB.IFC.ExporterIFCUtils.GetIFCClassNameByCategory(ElementId catId, ExporterIfc exporterIfc );

I don't know how do i get the  exporterIfc. Searched that a lot, but i didn't found anything useful.

I would be grateful if you could help me with this.

 

 

0 Likes
1,657 Views
5 Replies
Replies (5)
Message 2 of 6

cwaluga
Advocate
Advocate

There is no way to determine a meaningful class name from many categories (what class is “Mechanical Equipment” for instance?). What the given function does is to give access to the fallback table, where you can configure a mapping on category level. For export purposes one however needs to classify each type which cannot be mapped like this using the IfcExportAs parameter. This parameter can be easily read, provided someone filled it out beforehand.

0 Likes
Message 3 of 6

Anonymous
Not applicable

Maybe i couldn't made my point properly.

I want to know the IFC Class Name of a category, for example:

Levels ==> IfcBuildingStorey

Walls ==> IfcWallStandardCase

Mechanical Equipment ==> IfcSpaceHeater

.

.

.

 

like you see in attached picture.

is there a way to find that for each element?

0 Likes
Message 4 of 6

cwaluga
Advocate
Advocate

There is no meaningful mapping for „Mechanical Equipment“, that is the whole point (ME could be anything but an IfcSpaceHeater).

 

If you want the table, just read the file at Application.ImportIFCCategoryTable (tab-separated columns) and recover the mapping from there. the information there is the same as in your screenshot, hence the user can change this in any way. 

https://www.revitapidocs.com/2019/f55f827b-c745-26d5-48be-5f41851fbbc8.htm

 

It may also help if you said what you try to achieve in the long run.

0 Likes
Message 5 of 6

jeremytammik
Autodesk
Autodesk

The contents of the AutoDesk.Revit.DB.IFC namespace is provided by one of the Revit API .NET assemblies.

 

They all live in the same directory as Revit.exe and RevitAPI.dll.

 

One good candidate for this is certainly RevitAPIIFC.dll.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 6 of 6

cwaluga
Advocate
Advocate

Jeremy, the issue is that he cannot get an instance of ExporterIFC as required by the API. An instance of this class is provided to clients which implement IExporterIFC. As far as I can see it is not user-createable. I think implementing and installing an exporter just to obtain the exporter instance and read the mapping table is overkill.