Arch IFC: Difference between revisions
m (Minor change to update ifc Doc links) |
m ([[ | ]]) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 5: | Line 5: | ||
<!--T:5--> |
<!--T:5--> |
||
The [[Arch |
The [[Arch Workbench|Arch]] and [[BIM Workbench|BIM]] workbenches feature an [http://en.wikipedia.org/wiki/Industry_Foundation_Classes Industry Foundation Classes (IFC)] importer and exporter. The IFC format is a more and more widely spread format to interchange data between [http://en.wikipedia.org/wiki/Building_Information_Modeling BIM] applications, used in architecture and engineering. |
||
<!--T:6--> |
<!--T:6--> |
||
Both the importer and exporter depend on an external piece of open-source software, called [http://ifcopenshell.org IfcOpenShell], which might or might not be bundled with your version of FreeCAD, depending on the platform and where you obtained your FreeCAD package from. If IfcOpenShell is correctly installed, it will be detected by FreeCAD and used to import and export IFC files. An easy way to check if IfcOpenShell is present and available, is either to try to import or export an IFC file, or simply enter the following in the FreeCAD Python Console (found under menu View->Panels): |
|||
<!--T:21--> |
|||
import IfcOpenShell |
|||
<!--T:22--> |
|||
If no error message appears, everything is fine, IfcOpenShell is correctly installed. Otherwise, you will need to install it yourself. Read on. |
|||
<!--T:23--> |
|||
'''Note''': The [[BIM Setup|BIM Setup]] tool will look for IfcOpenShell too and issue a notification if it is not installed. |
|||
<!--T:24--> |
|||
'''Note''': The Arch Workbench used to feature in the past a simpler IFC importer that doesn't depend on IfcOpenShell. It is still possible to force the use of that old python IFC importer, by enabling the related option in the Arch preferences settings. But this importer has been discontinued, might not work properly, and will only be able to import a very small subset of IFC objects. |
|||
<!--T:7--> |
<!--T:7--> |
||
The use of IfcOpenShell is highly recommended, since it is much faster and more powerful than the internal parser. |
The use of IfcOpenShell is highly recommended, since it is much faster and more powerful than the internal parser. We think it is one of the best IFC handlers out there... |
||
==Obtaining IfcOpenShell== <!--T:25--> |
|||
<!--T:26--> |
|||
On the [http://ifcopenshell.org IfcOpenShell] website, you will find download links for the various utilities that compose the IfcOpenShell program. What FreeCAD needs is the one called '''IfcOpenShell-Python'''. You must take care of choosing the correct architecture for your operating system (32bits or 64bits), and also need the '''exact same Python version''' as FreeCAD. The Python version used by FreeCAD is indicated on the first line of the FreeCAD Python Console, found under menu View->Panels. You need a version of IfcOpenShell with the same two first numbers. The third number is not important. For example, if your FreeCAD Python version is 3.7.4, you need an IfcOpenShell version 3.7. |
|||
===IfcOpenBot=== <!--T:27--> |
|||
<!--T:28--> |
|||
The packages available on the IfcOpenShell website are, however, usually very old and don't support more recent Python versions. We therefore recommend you to use another service provided by the developers of IfcOpenShell, which is called [https://github.com/IfcOpenBot/IfcOpenShell IfcOpenBot]. It is an automated system that builds a series of packages from time to time from the IfcOpenShell source code. To download one of these packages, click the "Commits" link on the GitHub repository, and locate commits that have a comment (a small "message" icon). Those comments are where you will find the packeges built by IfcOpenBot. |
|||
<!--T:29--> |
|||
At the time of writing, the current stable version of IfcOpenShell, which lies in its "master" branch, is v0.5. However, v0.6 is already very stable and contains many improvements such as support for both IFC2x3 and IFC4 at the same time. We recommend you to switch the "branch" button to v0.6 and use one of these instead. Again, make sure you download the correct package for your version of FreeCAD. |
|||
===Compiling=== <!--T:30--> |
|||
<!--T:31--> |
|||
You can also [[Import/Export_IFC_-_compiling_IfcOpenShell|compile IfcOpenShell yourself]], of course. As it has almost the same dependencies as FreeCAD, if you are already compiling FreeCAD yourself, compiling IfcOpenShell will be very straightforward and will normally not require any additional dependency. |
|||
==Installing IfcOpenShell== <!--T:32--> |
|||
<!--T:33--> |
|||
The package you downloaded from one of the above locations is a zip file that contains a folder named "ifcopenshell" with several other files and folders inside. To "install" it simply means make this ifcopenshell folder found by Python (so the ''import ifcopenshell'' command we used above succeeds). The list of folders where Python looks for modules can be obtained by entering these two lines in the FreeCAD Python Console: |
|||
<!--T:34--> |
|||
import sys |
|||
for p in sys.path: print(p) |
|||
<!--T:35--> |
|||
and press enter twice. |
|||
<!--T:36--> |
|||
To install IfcOpenShell, just unzip the downloaded package, and place the "ifcopenshell" folder in any of the locations issued by the commands above. |
|||
<!--T:37--> |
|||
You will notice that some of these locations are system folders (the officially recommended locations are the "site-packages" or "dist-packages" folders), which will make IfcOpenShell installed system-wide and available to other applications such as Blender, but you might prefer to not pollute your system folders with something copied by hand, and place it in one of the folders of FreeCAD itself. Good suggestions are FreeCAD's "bin" folder, or the macros folder (which you can also obtain from menu Macro->Macros) |
|||
<!--T:38--> |
|||
Once you copied your ifcopenshell folder at one of these locations, test that it works correctly by entering: |
|||
<!--T:39--> |
|||
import ifcopenshell |
|||
<!--T:40--> |
|||
in the Python console of FreeCAD. If no error appears, you are good to go. |
|||
==Importing== <!--T:4--> |
==Importing== <!--T:4--> |
||
<!--T:12--> |
<!--T:12--> |
||
All [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifckernel/lexical/ifcproduct.htm IfcProduct]-based entities from IFC2x3 or IFC4 files will be imported into the FreeCAD document. The IFC preferences settings allow you to set how the IFC objects are imported: as full parametric Arch objects, as non-parametric Arch objects, as non-parametric Part shapes, or as one Part shape per floor. Each of these types looses some information over the previous one, but is lighter on resources, which allows to open bigger files. A last type allows to discard entirely the importing of Arch objects, which is useful for structural analytic models. |
All [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifckernel/lexical/ifcproduct.htm IfcProduct]-based entities from IFC2x3 or IFC4 files will be imported into the FreeCAD document. The IFC preferences settings allow you to set how the IFC objects are imported: as '''full parametric Arch objects''' (the geometry will, as much as possible, be editable in FreeCAD), as '''non-parametric Arch objects''' (objects will carry IFC information and properties but will not be editable), as '''non-parametric Part shapes''' (the geometry will be faithfully rendered but IFC information will be discarded), or as '''one Part shape per floor''' (one all-in-one object, just for reference). Each of these types looses some information over the previous one, but is lighter on resources, which allows to open bigger files. A last type allows to discard entirely the importing of Arch objects, which is useful for structural analytic models. |
||
<!--T:41--> |
|||
Typically, if you try to open a large file and FreeCAD takes too long to import it, try with a lower import mode. |
|||
<!--T:42--> |
|||
IfcOpenShell supports all IFC2x3 and IFC4 entities (IFC4-add1 and IFC4-add2 are being implemented in v0.6 and might be available by the time you read this) but not all of them can be converted to [[Arch Module|Arch]] objects, those that can't will be imported as simple [[Part Module|Part]] shapes. The IFC importer starts by importing all IFC entities derived from http://standards.buildingsmart.org/IFC/RELEASE/IFC2x3/TC1/HTML/ifckernel/lexical/ifcproduct.htm IfcProduct], that is, basically, all the objects that compose a building, such as walls or windows or pipes. All other entities needed by one of these objects, such as profiles of extrusion, or components of boolean operations, will be imported as required. |
|||
<!--T:13--> |
<!--T:13--> |
||
If |
If using an import mode that uses Arch objects, being parametric or not, all objects will carry the full set of [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcpropertyresource/lexical/ifcproperty.htm IfcProperties] attached to each object, grouped by Property Set. |
||
<!--T:43--> |
|||
Building structures such as Sites, Buildings and Storeys are also faithfully imported and the structure is correctly recreated in FreeCAD. Group structures (using IfcGroups) are also imported and rendered in FreeCAD, and can be combined with building structures, for ex. having groups inside storeys or storeys inside groups. |
|||
<!--T:14--> |
<!--T:14--> |
||
[http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcproductextension/lexical/ifcannotation.htm IfcAnnotation] objects are also imported, as well as linear and curve-based [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcstructuralanalysisdomain/lexical/ifcstructuralitem.htm IfcStructuralItem]-based entities. |
[http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcproductextension/lexical/ifcannotation.htm IfcAnnotation] objects are also imported, as well as linear and curve-based [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcstructuralanalysisdomain/lexical/ifcstructuralitem.htm IfcStructuralItem]-based entities. |
||
<!--T:44--> |
|||
Quantities specified in the IFC file are '''NOT''' imported. However, since the geometry is fully recreated in FreeCAD, most of the quantities such as length, area, etc.. are easily obtainable for each object |
|||
<!--T:15--> |
<!--T:15--> |
||
Enabling the '''show debug messages''' in the IFC preferences settings will print a report indicating if any object from the IFC file failed to import. |
Enabling the '''show debug messages''' in the IFC preferences settings will print a report indicating if any object from the IFC file failed to import. |
||
<!--T:45--> |
|||
'''Note''': The BIM Workbench features an [[BIM IfcExplorer|IFC explorer]] tool that allows you to open an IFC file in fast, text-only mode, and import only the parts you wish. |
|||
== Exporting == <!--T:9--> |
== Exporting == <!--T:9--> |
||
<!--T:10--> |
<!--T:10--> |
||
Exporting to IFC files will export all the selected objects and their descendants. All Arch/BIM objects are supported, as well as other objects created in other workbenches. The only not fully supported objects, at the moment, are PartDesign bodies, App Parts, and new structures such as Links and LinkGroups, so you will need a bit of testing if using them. [[Arch Reference|Arch References]] will currently export as IfcBuildingElementProxies. |
|||
⚫ | |||
<!--T:46--> |
|||
⚫ | To export a whole site or building or a whole floor or a group containing other objects, it is only needed to select that building or floor or group. Arch objects will be exported with the type set in their "IFC Type" property. Their [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcpropertyresource/lexical/ifcproperty.htm IfcProperties] are exported as well, and if these objects have an IFC UID from a previous import, the same UID will be kept at export. Objects that are not Arch objects are exported as [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcsharedbldgelements/lexical/ifcbuildingelementproxy.htm IfcBuildingElementProxy]. |
||
<!--T:16--> |
<!--T:16--> |
||
IFC files are exported as IFC2x3 or IFC4 depending on your version of IfcOpenShell, which can be compiled with any of the IFC schemas. |
IFC files are exported as IFC2x3 or IFC4 depending on your version of IfcOpenShell, which can be compiled with any of the IFC schemas. If using IfcOpenShell v0.6 or higher, the IFC version specified in the Arch preferences will be used. |
||
<!--T:17--> |
<!--T:17--> |
||
If the shape of exported objects is based on an extrusion or a boolean operation, the operation and components will be correctly exported to IFC. If not, the object's shape is exported as [http://www.buildingsmart-tech.org/ifc/IFC4x1/html/schema/ifcgeometricmodelresource/lexical/ifcfacetedbrep.htm IfcFacetedBrep]. If the shape contains curves, these will be |
If the shape of exported objects is based on an extrusion or a boolean operation, the operation and components will be correctly exported to IFC. If not, the object's shape is exported as [http://www.buildingsmart-tech.org/ifc/IFC4x1/html/schema/ifcgeometricmodelresource/lexical/ifcfacetedbrep.htm IfcFacetedBrep]. If the shape contains curves, these will be triangulated. However, IfcOpenShell v0.5 or above feature a serializer, which must be enabled in the Import/Export->IFC preferences. If enabled, this serializer is able to export very complex curved objects such as those based on NURBS, and thus avoid triangulated faces. At the time of writing, though, few other BIM applications support IFC NURBS objects, so a bit of testing is advised. |
||
==Links== <!--T:18--> |
==Links== <!--T:18--> |
Revision as of 09:22, 7 September 2019
The Arch and BIM workbenches feature an Industry Foundation Classes (IFC) importer and exporter. The IFC format is a more and more widely spread format to interchange data between BIM applications, used in architecture and engineering.
Both the importer and exporter depend on an external piece of open-source software, called IfcOpenShell, which might or might not be bundled with your version of FreeCAD, depending on the platform and where you obtained your FreeCAD package from. If IfcOpenShell is correctly installed, it will be detected by FreeCAD and used to import and export IFC files. An easy way to check if IfcOpenShell is present and available, is either to try to import or export an IFC file, or simply enter the following in the FreeCAD Python Console (found under menu View->Panels):
import IfcOpenShell
If no error message appears, everything is fine, IfcOpenShell is correctly installed. Otherwise, you will need to install it yourself. Read on.
Note: The BIM Setup tool will look for IfcOpenShell too and issue a notification if it is not installed.
Note: The Arch Workbench used to feature in the past a simpler IFC importer that doesn't depend on IfcOpenShell. It is still possible to force the use of that old python IFC importer, by enabling the related option in the Arch preferences settings. But this importer has been discontinued, might not work properly, and will only be able to import a very small subset of IFC objects.
The use of IfcOpenShell is highly recommended, since it is much faster and more powerful than the internal parser. We think it is one of the best IFC handlers out there...
Obtaining IfcOpenShell
On the IfcOpenShell website, you will find download links for the various utilities that compose the IfcOpenShell program. What FreeCAD needs is the one called IfcOpenShell-Python. You must take care of choosing the correct architecture for your operating system (32bits or 64bits), and also need the exact same Python version as FreeCAD. The Python version used by FreeCAD is indicated on the first line of the FreeCAD Python Console, found under menu View->Panels. You need a version of IfcOpenShell with the same two first numbers. The third number is not important. For example, if your FreeCAD Python version is 3.7.4, you need an IfcOpenShell version 3.7.
IfcOpenBot
The packages available on the IfcOpenShell website are, however, usually very old and don't support more recent Python versions. We therefore recommend you to use another service provided by the developers of IfcOpenShell, which is called IfcOpenBot. It is an automated system that builds a series of packages from time to time from the IfcOpenShell source code. To download one of these packages, click the "Commits" link on the GitHub repository, and locate commits that have a comment (a small "message" icon). Those comments are where you will find the packeges built by IfcOpenBot.
At the time of writing, the current stable version of IfcOpenShell, which lies in its "master" branch, is v0.5. However, v0.6 is already very stable and contains many improvements such as support for both IFC2x3 and IFC4 at the same time. We recommend you to switch the "branch" button to v0.6 and use one of these instead. Again, make sure you download the correct package for your version of FreeCAD.
Compiling
You can also compile IfcOpenShell yourself, of course. As it has almost the same dependencies as FreeCAD, if you are already compiling FreeCAD yourself, compiling IfcOpenShell will be very straightforward and will normally not require any additional dependency.
Installing IfcOpenShell
The package you downloaded from one of the above locations is a zip file that contains a folder named "ifcopenshell" with several other files and folders inside. To "install" it simply means make this ifcopenshell folder found by Python (so the import ifcopenshell command we used above succeeds). The list of folders where Python looks for modules can be obtained by entering these two lines in the FreeCAD Python Console:
import sys for p in sys.path: print(p)
and press enter twice.
To install IfcOpenShell, just unzip the downloaded package, and place the "ifcopenshell" folder in any of the locations issued by the commands above.
You will notice that some of these locations are system folders (the officially recommended locations are the "site-packages" or "dist-packages" folders), which will make IfcOpenShell installed system-wide and available to other applications such as Blender, but you might prefer to not pollute your system folders with something copied by hand, and place it in one of the folders of FreeCAD itself. Good suggestions are FreeCAD's "bin" folder, or the macros folder (which you can also obtain from menu Macro->Macros)
Once you copied your ifcopenshell folder at one of these locations, test that it works correctly by entering:
import ifcopenshell
in the Python console of FreeCAD. If no error appears, you are good to go.
Importing
All IfcProduct-based entities from IFC2x3 or IFC4 files will be imported into the FreeCAD document. The IFC preferences settings allow you to set how the IFC objects are imported: as full parametric Arch objects (the geometry will, as much as possible, be editable in FreeCAD), as non-parametric Arch objects (objects will carry IFC information and properties but will not be editable), as non-parametric Part shapes (the geometry will be faithfully rendered but IFC information will be discarded), or as one Part shape per floor (one all-in-one object, just for reference). Each of these types looses some information over the previous one, but is lighter on resources, which allows to open bigger files. A last type allows to discard entirely the importing of Arch objects, which is useful for structural analytic models.
Typically, if you try to open a large file and FreeCAD takes too long to import it, try with a lower import mode.
IfcOpenShell supports all IFC2x3 and IFC4 entities (IFC4-add1 and IFC4-add2 are being implemented in v0.6 and might be available by the time you read this) but not all of them can be converted to Arch objects, those that can't will be imported as simple Part shapes. The IFC importer starts by importing all IFC entities derived from http://standards.buildingsmart.org/IFC/RELEASE/IFC2x3/TC1/HTML/ifckernel/lexical/ifcproduct.htm IfcProduct], that is, basically, all the objects that compose a building, such as walls or windows or pipes. All other entities needed by one of these objects, such as profiles of extrusion, or components of boolean operations, will be imported as required.
If using an import mode that uses Arch objects, being parametric or not, all objects will carry the full set of IfcProperties attached to each object, grouped by Property Set.
Building structures such as Sites, Buildings and Storeys are also faithfully imported and the structure is correctly recreated in FreeCAD. Group structures (using IfcGroups) are also imported and rendered in FreeCAD, and can be combined with building structures, for ex. having groups inside storeys or storeys inside groups.
IfcAnnotation objects are also imported, as well as linear and curve-based IfcStructuralItem-based entities.
Quantities specified in the IFC file are NOT imported. However, since the geometry is fully recreated in FreeCAD, most of the quantities such as length, area, etc.. are easily obtainable for each object
Enabling the show debug messages in the IFC preferences settings will print a report indicating if any object from the IFC file failed to import.
Note: The BIM Workbench features an IFC explorer tool that allows you to open an IFC file in fast, text-only mode, and import only the parts you wish.
Exporting
Exporting to IFC files will export all the selected objects and their descendants. All Arch/BIM objects are supported, as well as other objects created in other workbenches. The only not fully supported objects, at the moment, are PartDesign bodies, App Parts, and new structures such as Links and LinkGroups, so you will need a bit of testing if using them. Arch References will currently export as IfcBuildingElementProxies.
To export a whole site or building or a whole floor or a group containing other objects, it is only needed to select that building or floor or group. Arch objects will be exported with the type set in their "IFC Type" property. Their IfcProperties are exported as well, and if these objects have an IFC UID from a previous import, the same UID will be kept at export. Objects that are not Arch objects are exported as IfcBuildingElementProxy.
IFC files are exported as IFC2x3 or IFC4 depending on your version of IfcOpenShell, which can be compiled with any of the IFC schemas. If using IfcOpenShell v0.6 or higher, the IFC version specified in the Arch preferences will be used.
If the shape of exported objects is based on an extrusion or a boolean operation, the operation and components will be correctly exported to IFC. If not, the object's shape is exported as IfcFacetedBrep. If the shape contains curves, these will be triangulated. However, IfcOpenShell v0.5 or above feature a serializer, which must be enabled in the Import/Export->IFC preferences. If enabled, this serializer is able to export very complex curved objects such as those based on NURBS, and thus avoid triangulated faces. At the time of writing, though, few other BIM applications support IFC NURBS objects, so a bit of testing is advised.
Links
Tutorial Import/Export IFC - compiling IfcOpenShell
- Elements: Wall, Structure, Curtain Wall, Window, Roof, Space, Stairs, Equipment, Frame, Fence, Truss, Profile, Pipe, Pipe Connector
- Reinforcements: Straight Rebar, U-Shape Rebar, L-Shape Rebar, Stirrup, Bent-Shape Rebar, Helical Rebar, Column Reinforcement, Beam Reinforcement, Slab Reinforcement, Footing Reinforcement, Custom Rebar
- Panels: Panel, Panel Cut, Panel Sheet, Nest
- Materials: Material, Multi-Material
- Organization: Building Part, Project, Site, Building, Level, External reference, Section Plane, Schedule
- Axes: Axis, Axes system, Grid
- Modification: Cut with plane, Add component, Remove component, Survey
- Utilities: Component, Clone component, Split Mesh, Mesh to Shape, Select non-manifold meshes, Remove Shape from Arch, Close Holes, Merge Walls, Check, Toggle IFC Brep flag, 3 Views from mesh, Create IFC spreadsheet, Toggle Subcomponents
- Additional: Preferences, Import Export Preferences (IFC, DAE, OBJ, JSON, 3DS, SHP), IfcOpenShell, IfcPlusPlus, Arch API
![](/images/thumb/9/94/User_hub.png/24px-User_hub.png)
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub