Arch IFC/fr: Difference between revisions

From FreeCAD Documentation
(Created page with "Toutes les entités [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifckernel/lexical/ifcproduct.htm IfcProduct] à partir de fichiers IFC2x3 ou IFC4 seront impor...")
(Updating to match new version of source page)
(11 intermediate revisions by 2 users not shown)
Line 2: Line 2:
{{docnav||[[Arch DAE/fr|DAE]]|[[Arch_Module/fr|Atelier architecture]]}}
{{docnav||[[Arch DAE/fr|DAE]]|[[Arch_Module/fr|Atelier architecture]]}}


<div class="mw-translate-fuzzy">
L'[[Arch Module/fr|atelier architecture]] contient un importateur [https://fr.wikipedia.org/wiki/Industry_Foundation_Classes (IFC)]. Le format IFC est un format de plus en plus répandu pour l'échange de données entre les applications [https://fr.wikipedia.org/wiki/Building_information_modeling BIM], utilisés en architecture et en ingénierie.
L'[[Arch Module/fr|atelier architecture]] contient un importateur [https://fr.wikipedia.org/wiki/Industry_Foundation_Classes (IFC)]. Le format IFC est un format de plus en plus répandu pour l'échange de données entre les applications [https://fr.wikipedia.org/wiki/Building_information_modeling BIM], utilisés en architecture et en ingénierie.
</div>


<div class="mw-translate-fuzzy">
L'importateur est toujours en cours de développement et dépend d'un logiciel externe open-source appelé [http://ifcopenshell.org IfcOpenShell]. Il n'est pas fourni avec FreeCAD et doit être [[Extra_python_modules/fr|installé sur votre système]]. Si IfcOpenShell est correctement installé, il sera détecté par FreeCAD et utilisé pour importer des fichiers IFC. Il est toujours possible de forcer l'utilisation de l'ancien importateur IFC python qui ne dépend pas d'IfcOpenShell en activant l'option associée dans les paramètres de préférences Arch. Ce dernier importateur a été arrêté et ne pourra importer qu'un petit sous-ensemble d'objets IFC.
L'importateur est toujours en cours de développement et dépend d'un logiciel externe open-source appelé [http://ifcopenshell.org IfcOpenShell]. Il n'est pas fourni avec FreeCAD et doit être [[Extra_python_modules/fr|installé sur votre système]]. Si IfcOpenShell est correctement installé, il sera détecté par FreeCAD et utilisé pour importer des fichiers IFC. Il est toujours possible de forcer l'utilisation de l'ancien importateur IFC python qui ne dépend pas d'IfcOpenShell en activant l'option associée dans les paramètres de préférences Arch. Ce dernier importateur a été arrêté et ne pourra importer qu'un petit sous-ensemble d'objets IFC.
</div>


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|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.

<div class="mw-translate-fuzzy">
L’utilisation de IfcOpenShell est fortement recommandée car elle est beaucoup plus rapide et plus puissante que le parseur interne. IfcOpenShell prend en charge toutes les entités IFC2x3 et IFC4 qui contiennent des informations de géométrie. Toutes ne peuvent pas être converties en objets de l'[[Arch Module/fr|Atelier architecture]]. Celles qui ne peuvent pas être importées le seront sous forme de simples formes de l'[[Part Module/fr|Atelier part]].
L’utilisation de IfcOpenShell est fortement recommandée car elle est beaucoup plus rapide et plus puissante que le parseur interne. IfcOpenShell prend en charge toutes les entités IFC2x3 et IFC4 qui contiennent des informations de géométrie. Toutes ne peuvent pas être converties en objets de l'[[Arch Module/fr|Atelier architecture]]. Celles qui ne peuvent pas être importées le seront sous forme de simples formes de l'[[Part Module/fr|Atelier part]].
</div>

==Obtaining IfcOpenShell==

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===

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.

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 [[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==

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.


==Importation==
==Importation==


<div class="mw-translate-fuzzy">
Toutes les entités [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifckernel/lexical/ifcproduct.htm IfcProduct] à partir de fichiers IFC2x3 ou IFC4 seront importées dans le document FreeCAD. Les paramètres de préférences IFC vous permettent de définir le mode d'importation des objets IFC: en tant qu'objets Arch paramétriques complets, en tant qu'objets Arch non paramétriques, en tant que formes de pièce non paramétriques ou en tant que forme de pièce par étage. Chacun de ces types perd des informations par rapport au précédent mais est plus léger en ressources ce qui permet d’ouvrir des fichiers plus volumineux. Un dernier type permet de supprimer complètement l'importation d'objets Arch ce qui est utile pour les modèles analytiques structurels.
Toutes les entités [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifckernel/lexical/ifcproduct.htm IfcProduct] à partir de fichiers IFC2x3 ou IFC4 seront importées dans le document FreeCAD. Les paramètres de préférences IFC vous permettent de définir le mode d'importation des objets IFC: en tant qu'objets Arch paramétriques complets, en tant qu'objets Arch non paramétriques, en tant que formes de pièce non paramétriques ou en tant que forme de pièce par étage. Chacun de ces types perd des informations par rapport au précédent mais est plus léger en ressources ce qui permet d’ouvrir des fichiers plus volumineux. Un dernier type permet de supprimer complètement l'importation d'objets Arch ce qui est utile pour les modèles analytiques structurels.
</div>


Typically, if you try to open a large file and FreeCAD takes too long to import it, try with a lower import mode.
If parametric Arch objects are used, for all IFC types that have an equivalent in the Arch Module, the corresponding type is used. For the others, a generic Part shape is created. All Arch objects, parametric and non-parametric, 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.


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.
[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.


<div class="mw-translate-fuzzy">
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.
Si des objets Arch paramétriques sont utilisés, le type correspondant est utilisé pour tous les types IFC ayant un équivalent dans le module Arch. Pour les autres, une forme de pièce générique est créée. Tous les objets Arch, paramétriques et non paramétriques, porteront l’ensemble complet de [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcpropertyresource/lexical/ifcproperty.htm IfcProperties] rattaché à chaque objet.
</div>


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.
== Exporting ==


Exporting to IFC files will export all the selected objects and their descendants. To export a whole building or a whole floor, it is only needed to select the building or floor object. Arch objects will be exported with the type set in their "Role" 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].
Les objets [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcproductextension/lexical/ifcannotation.htm IfcAnnotation] sont également importés ainsi que les objets linéaires ou basés sur des courbes [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcstructuralanalysisdomain/lexical/ifcstructuralitem.htm IfcStructuralItem].


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
IFC files are exported as IFC2x3 or IFC4 depending on your version of IfcOpenShell, which can be compiled with any of the IFC schemas.


Activer '''afficher les messages de débogage''' dans les paramètres de préférences IFC indiquera si un objet à partir du fichier IFC n'aura pas été importé correctement.
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 faceted.


'''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.
==Links==

Tutorial [[Import/Export_IFC_-_compiling_IfcOpenShell|Import/Export IFC - compiling IfcOpenShell]]
==Exportation==


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
L'exportation vers des fichiers IFC exportera tous les objets sélectionnés et leurs descendants. Pour exporter un bâtiment entier ou un étage entier, il suffit de sélectionner le bâtiment ou l'objet étage. Les objets Arch seront exportés avec le type défini dans leur propriété "Role". Leurs propriétés IFC [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcpropertyresource/lexical/ifcproperty.htm IfcProperties] sont également exportées et si ces objets ont un UID IFC d'une importation précédente, le même UID sera conservé à l'exportation. Les objets qui ne sont pas des objets Arch sont exportés sous le nom [http://www.buildingsmart-tech.org/ifc/IFC4/Add1/html/schema/ifcsharedbldgelements/lexical/ifcbuildingelementproxy.htm IfcBuildingElementPRoxy].
[[Category:Arch/fr]]
</div>
</div>

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].

<div class="mw-translate-fuzzy">
Les fichiers IFC sont exportés au format IFC2x3 ou IFC4 en fonction de votre version d'IfcOpenShell qui peut être compilée avec n'importe lequel des schémas IFC.
</div>

<div class="mw-translate-fuzzy">
Si la forme des objets exportés est basée sur une extrusion ou une opération booléenne, l'opération et les composants seront correctement exportés au format IFC. Si ce n'est pas le cas, la forme de l'objet est exportée sous le nom [http://www.buildingsmart-tech.org/ifc/IFC4x1/html/schema/ifcgeometricmodelresource/lexical/ifcfacetedbrep.htm IfcFacetedBrep]. Si la forme contient des courbes, celles-ci seront facettées.
</div>

==Liens==
Tutoriel [[Import/Export_IFC_-_compiling_IfcOpenShell/fr|Importer/Exporter IFC - compiler IfcOpenShell]]

{{docnav/fr||[[Arch DAE/fr|DAE]]|[[Arch_Module/fr|Atelier architecture]]}}
{{Arch Tools navi/fr}}
{{Userdocnavi/fr}}

Revision as of 09:23, 7 September 2019

L'atelier architecture contient un importateur (IFC). Le format IFC est un format de plus en plus répandu pour l'échange de données entre les applications BIM, utilisés en architecture et en ingénierie.

L'importateur est toujours en cours de développement et dépend d'un logiciel externe open-source appelé IfcOpenShell. Il n'est pas fourni avec FreeCAD et doit être installé sur votre système. Si IfcOpenShell est correctement installé, il sera détecté par FreeCAD et utilisé pour importer des fichiers IFC. Il est toujours possible de forcer l'utilisation de l'ancien importateur IFC python qui ne dépend pas d'IfcOpenShell en activant l'option associée dans les paramètres de préférences Arch. Ce dernier importateur a été arrêté et ne pourra importer qu'un petit sous-ensemble d'objets IFC.

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.

L’utilisation de IfcOpenShell est fortement recommandée car elle est beaucoup plus rapide et plus puissante que le parseur interne. IfcOpenShell prend en charge toutes les entités IFC2x3 et IFC4 qui contiennent des informations de géométrie. Toutes ne peuvent pas être converties en objets de l'Atelier architecture. Celles qui ne peuvent pas être importées le seront sous forme de simples formes de l'Atelier part.

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.

Importation

Toutes les entités IfcProduct à partir de fichiers IFC2x3 ou IFC4 seront importées dans le document FreeCAD. Les paramètres de préférences IFC vous permettent de définir le mode d'importation des objets IFC: en tant qu'objets Arch paramétriques complets, en tant qu'objets Arch non paramétriques, en tant que formes de pièce non paramétriques ou en tant que forme de pièce par étage. Chacun de ces types perd des informations par rapport au précédent mais est plus léger en ressources ce qui permet d’ouvrir des fichiers plus volumineux. Un dernier type permet de supprimer complètement l'importation d'objets Arch ce qui est utile pour les modèles analytiques structurels.

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.

Si des objets Arch paramétriques sont utilisés, le type correspondant est utilisé pour tous les types IFC ayant un équivalent dans le module Arch. Pour les autres, une forme de pièce générique est créée. Tous les objets Arch, paramétriques et non paramétriques, porteront l’ensemble complet de IfcProperties rattaché à chaque objet.

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.

Les objets IfcAnnotation sont également importés ainsi que les objets linéaires ou basés sur des courbes IfcStructuralItem.

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

Activer afficher les messages de débogage dans les paramètres de préférences IFC indiquera si un objet à partir du fichier IFC n'aura pas été importé correctement.

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.

Exportation

L'exportation vers des fichiers IFC exportera tous les objets sélectionnés et leurs descendants. Pour exporter un bâtiment entier ou un étage entier, il suffit de sélectionner le bâtiment ou l'objet étage. Les objets Arch seront exportés avec le type défini dans leur propriété "Role". Leurs propriétés IFC IfcProperties sont également exportées et si ces objets ont un UID IFC d'une importation précédente, le même UID sera conservé à l'exportation. Les objets qui ne sont pas des objets Arch sont exportés sous le nom IfcBuildingElementPRoxy.

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.

Les fichiers IFC sont exportés au format IFC2x3 ou IFC4 en fonction de votre version d'IfcOpenShell qui peut être compilée avec n'importe lequel des schémas IFC.

Si la forme des objets exportés est basée sur une extrusion ou une opération booléenne, l'opération et les composants seront correctement exportés au format IFC. Si ce n'est pas le cas, la forme de l'objet est exportée sous le nom IfcFacetedBrep. Si la forme contient des courbes, celles-ci seront facettées.

Liens

Tutoriel Importer/Exporter IFC - compiler IfcOpenShell