Convert Autodesk.Revit.DB.Element to IFC file

Convert Autodesk.Revit.DB.Element to IFC file

Anonymous
Not applicable
618 Views
0 Replies
Message 1 of 1

Convert Autodesk.Revit.DB.Element to IFC file

Anonymous
Not applicable

Hello everyone

 

I am trying to get the coordinates from a specific area of a building information model in an IFC file.

 

I have managed so far to write the code for getting the area as an Autodesk.Revit.DB.Element .

 

How can I export this to an IFC file now ?

 

I suppose that I must somehow use Autodesk.Revit.DB.IFC.ExporterIFC and Autodesk.Revit.DB.IFC.IFCFile but since I am not familiar with C# and the Revit API I don't know exactly how to do this ...

 

Any ideas ?

 

This is the code I have so far :

 

            //Get application and document objects
            UIApplication uiApp = commandData.Application;
            Document doc = uiApp.ActiveUIDocument.Document;

            //Define a Reference object to accept the pick result.
            Reference pickedRef = null;

            //Pick a group.
            Selection sel = uiApp.ActiveUIDocument.Selection;
            pickedRef = sel.PickObject(ObjectType.Element, "Please select the pit");
            Element elem = doc.GetElement(pickedRef);
            Group group = elem as Group;

            // Export Group in IFC file to get the coordinates of the pit. -- pending

 Thank you 🙂

0 Likes
619 Views
0 Replies
Replies (0)