BIM Preflight: Difference between revisions

From FreeCAD Documentation
(Created page with "<languages/> <translate> {{GuiCommandAddon |Name=BIM Preflight |Workbenches=16px BIM |Addon=BIM |MenuLocation=Manage → Preflight check }...")
 
(Marked this version for translation)
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
<translate>
<translate>


<!--T:1-->
{{GuiCommandAddon
{{GuiCommandAddon
|Name=BIM Preflight
|Name=BIM Preflight
Line 9: Line 10:
}}
}}


==Description==
==Description== <!--T:2-->


<!--T:3-->
[[Image:BIM preflight screenshot.png|1024px]]
[[Image:BIM preflight screenshot.png|1024px]]


<!--T:4-->
As FreeCAD is a very loose and free-style modelling platform, the requirements are very low. You can basically model and organize your BIM model the way you like, using all the tools that FreeCAD offers, both from the BIM workbench and other workbenches. The IFC format, however, has some strict requirements, and other BIM applications that can read IFC files often bring additional limitations as they more than often have difficulties with certain entities or the way certain objects are modeled.
As FreeCAD is a very loose and free-style modelling platform, the requirements are very low. You can basically model and organize your BIM model the way you like, using all the tools that FreeCAD offers, both from the BIM workbench and other workbenches. The IFC format, however, has some strict requirements, and other BIM applications that can read IFC files often bring additional limitations as they more than often have difficulties with certain entities or the way certain objects are modeled.


<!--T:5-->
The BIM Preflight tool allows you to perform several tests on your model to verify its compatibility with IFC standards and best practices, and help you to detect possible issues you might want to fix.
The BIM Preflight tool allows you to perform several tests on your model to verify its compatibility with IFC standards and best practices, and help you to detect possible issues you might want to fix.


<!--T:6-->
The results of most of the tests provided by this tool are optional, which means you can choose to export your model even if they fail. You are the one to assess if you need the test to pass or not. We tried our best to give sound information to help you decide.
The results of most of the tests provided by this tool are optional, which means you can choose to export your model even if they fail. You are the one to assess if you need the test to pass or not. We tried our best to give sound information to help you decide.


==Usage==
==Usage== <!--T:7-->


<!--T:8-->
* Have a model opened in FreeCAD, with at least some objects
* Have a model opened in FreeCAD, with at least some objects
* You can select objects before launching the tests, in which case you have the option to perform the test only on the selected objects
* You can select objects before launching the tests, in which case you have the option to perform the test only on the selected objects
* Press the '''Test All''''button to perform all the tests, or only buttons corresponding to individual tests.
* Press the '''Test All''' button to perform all the tests, or only buttons corresponding to individual tests.
* When the tests have finished, pressing a '''Failed''' button will give you additional information to help you decide if this is relevant to you or not.
* When the tests have finished, pressing a '''Failed''' button will give you additional information to help you decide if this is relevant to you or not.


==Available tests==
==Builtin tests== <!--T:9-->


<!--T:10-->
* '''Run all tests''': Runs all the tests one after the other
* '''Run all tests''': Runs all the tests one after the other


===FreeCAD setup tests===
===FreeCAD setup tests=== <!--T:11-->


<!--T:12-->
* '''IFC4 support''': Tests if the IFC import/export system of FreeCAD is working correctly, and if the IFC4 format is available (which requires an up-to-date version of [[Arch IFC|IfcOpenShell]] and enabled in the preferences.
* '''IFC4 support''': Tests if the IFC import/export system of FreeCAD is working correctly, and if the IFC4 format is available (which requires an up-to-date version of [[Arch IFC|IfcOpenShell]] and enabled in the preferences.


===Project organization tests===
===Project organization tests=== <!--T:13-->


<!--T:14-->
* '''Project hierarchy''': The IFC format requires at least one [[Arch Building|building]] and it is also a common practice to have one [[Arch Site|site]] and at least one [[Arch BuildingPart|level (storey)]]. This test checks if these are present in the model
* '''Project hierarchy''': The IFC format requires at least one [[Arch Building|building]] and it is also a common practice to have one [[Arch Site|site]] and at least one [[Arch BuildingPart|level (storey)]]. This test checks if these are present in the model
* '''Buildings''': Checks that all buildings found in the model are part of a [[Arch Site|site]]
* '''Buildings''': Checks that all buildings found in the model are part of a [[Arch Site|site]]
Line 41: Line 50:
* '''Objects structure''': Checks that all objects found in the model are part of a level
* '''Objects structure''': Checks that all objects found in the model are part of a level


===Objects & property tests===
===Objects & property tests=== <!--T:15-->


<!--T:16-->
* '''Undefined objects''': Checks if there are objects in the model that are not BIM objects, and will therefore be exported without full BIM properties
* '''Undefined objects''': Checks if there are objects in the model that are not BIM objects, and will therefore be exported without full BIM properties
* '''Solids''': Checks that all objects in the model have valid solid geometry
* '''Solids''': Checks that all objects in the model have valid solid geometry
Line 49: Line 59:
* '''Property sets integrity''': Checks that all common Psets (Pset_WallCommon, Pset_DoorCommon, etc) found in the model include all and only the properties defined by the IFC standards
* '''Property sets integrity''': Checks that all common Psets (Pset_WallCommon, Pset_DoorCommon, etc) found in the model include all and only the properties defined by the IFC standards
* '''Materials''': Checks that all BIM objects have a material
* '''Materials''': Checks that all BIM objects have a material
* '''Standards''': Checks that all BIM objects have a [[Ifc Classification|standard code]]
* '''Standards''': Checks that all BIM objects have a [[BIM Classification|standard code]]


===Compatibility tests===
===Compatibility tests=== <!--T:17-->


<!--T:18-->
* '''Extrusions''': Checks that all BIM objects are linear extrusions
* '''Extrusions''': Checks that all BIM objects are linear extrusions
* '''Standard cases''': Checks that all [[Arch Wall|walls]] and [[Arch Structure|structural elements]] are standard cases, as defined by the IFC schema
* '''Standard cases''': Checks that all [[Arch Wall|walls]] and [[Arch Structure|structural elements]] are standard cases, as defined by the IFC schema
Line 58: Line 69:
* '''IfcRectangleProfileDef''': Checks that the option to export rectangular profiles as IfcRectangleProfileDef is disabled, because Revit (yes, them again) is unable to import that entity.
* '''IfcRectangleProfileDef''': Checks that the option to export rectangular profiles as IfcRectangleProfileDef is disabled, because Revit (yes, them again) is unable to import that entity.


==Custom tests== <!--T:19-->

<!--T:20-->
The Preflight tool also allows you to write custom tests, that will be appended after the built-in tools in the Preflight dialog, and run when using the '''Run all tests''' button. These tests are written in Python. They consists of simple functions inside one or more Python files. You can perform any operation you want inside those functions, they must just pass or fail, and in case they fail, show a message informing the user of what failed.

<!--T:21-->
You can write several tests in one single Python file, or divide in several files, as you prefer. These files must be placed in $USERAPPDATA/BIM/Preflight and can be given any name (Be sure to use very unique names as to not conflict with any built-in Python module. The $USERAPPDATA folder depends on your platform/operating system (usually $HOME/.FreeCAD on linux/mac, /users/YOUR USER/Application Data/roaming/FreeCAD on windows), and can also be found by entering this in the FreeCAD Python console:

<!--T:22-->
FreeCAD.getUserAppDataDir()

<!--T:23-->
Inside each Python file, tests are simple functions that take no argument, and return either True if the test passed, or a string of text that will be shown to the user if the test failed.

<!--T:24-->
A typical test file would be like this, that should be named something like "myCustomTest.py" and placed inside $USERAPPDATA/BIM/Preflight:
</translate>
</translate>

import FreeCAD
# The name of your test. You can give the functions any name
# you want, the important is the description text below
def myCustomTest():
# This describes what your test does. For example,
# here, it checks that there is at least one object in the document.
# This text will appear next to the button in the Preflight tool
"""Checks that the document contains at least one object"""
doc = FreeCAD.ActiveDocument
objects = doc.Objects
if len(objects) >= 1:
result = True
else:
result = "This document contains no object"
# The function must return either True or a string of
# text if the test failed. The string or text will be displayed
# to the user when they press the "Failed" button.
return result

Latest revision as of 13:20, 16 April 2020

Other languages:

BIM Preflight

Menu location
Manage → Preflight check
Workbenches
BIM
Default shortcut
None
See also
None
 
This command is part of the BIM AddOn, that you can install via menu Tools → Addons Manager

Description

As FreeCAD is a very loose and free-style modelling platform, the requirements are very low. You can basically model and organize your BIM model the way you like, using all the tools that FreeCAD offers, both from the BIM workbench and other workbenches. The IFC format, however, has some strict requirements, and other BIM applications that can read IFC files often bring additional limitations as they more than often have difficulties with certain entities or the way certain objects are modeled.

The BIM Preflight tool allows you to perform several tests on your model to verify its compatibility with IFC standards and best practices, and help you to detect possible issues you might want to fix.

The results of most of the tests provided by this tool are optional, which means you can choose to export your model even if they fail. You are the one to assess if you need the test to pass or not. We tried our best to give sound information to help you decide.

Usage

  • Have a model opened in FreeCAD, with at least some objects
  • You can select objects before launching the tests, in which case you have the option to perform the test only on the selected objects
  • Press the Test All button to perform all the tests, or only buttons corresponding to individual tests.
  • When the tests have finished, pressing a Failed button will give you additional information to help you decide if this is relevant to you or not.

Builtin tests

  • Run all tests: Runs all the tests one after the other

FreeCAD setup tests

  • IFC4 support: Tests if the IFC import/export system of FreeCAD is working correctly, and if the IFC4 format is available (which requires an up-to-date version of IfcOpenShell and enabled in the preferences.

Project organization tests

  • Project hierarchy: The IFC format requires at least one building and it is also a common practice to have one site and at least one level (storey). This test checks if these are present in the model
  • Buildings: Checks that all buildings found in the model are part of a site
  • Levels: Checks that all levels (building storeys) found in the model are prt of a building
  • Objects structure: Checks that all objects found in the model are part of a level

Objects & property tests

  • Undefined objects: Checks if there are objects in the model that are not BIM objects, and will therefore be exported without full BIM properties
  • Solids: Checks that all objects in the model have valid solid geometry
  • Explicit quantities: Checks that all objects with length, width or height properties are marked for explicit export of these quantities
  • Common Properties sets: Checks that all BIM objects of common types (wall, door, etc...) have the corresponding "common" properry set applied (Pset_WallCommon, Pset_DoorCommon, etc)
  • Property sets integrity: Checks that all common Psets (Pset_WallCommon, Pset_DoorCommon, etc) found in the model include all and only the properties defined by the IFC standards
  • Materials: Checks that all BIM objects have a material
  • Standards: Checks that all BIM objects have a standard code

Compatibility tests

  • Extrusions: Checks that all BIM objects are linear extrusions
  • Standard cases: Checks that all walls and structural elements are standard cases, as defined by the IFC schema
  • Tiny lines: Checks that no line segment in the model is smaller than 1/32", the minimum length that Revit is able to manage...
  • IfcRectangleProfileDef: Checks that the option to export rectangular profiles as IfcRectangleProfileDef is disabled, because Revit (yes, them again) is unable to import that entity.

Custom tests

The Preflight tool also allows you to write custom tests, that will be appended after the built-in tools in the Preflight dialog, and run when using the Run all tests button. These tests are written in Python. They consists of simple functions inside one or more Python files. You can perform any operation you want inside those functions, they must just pass or fail, and in case they fail, show a message informing the user of what failed.

You can write several tests in one single Python file, or divide in several files, as you prefer. These files must be placed in $USERAPPDATA/BIM/Preflight and can be given any name (Be sure to use very unique names as to not conflict with any built-in Python module. The $USERAPPDATA folder depends on your platform/operating system (usually $HOME/.FreeCAD on linux/mac, /users/YOUR USER/Application Data/roaming/FreeCAD on windows), and can also be found by entering this in the FreeCAD Python console:

FreeCAD.getUserAppDataDir()

Inside each Python file, tests are simple functions that take no argument, and return either True if the test passed, or a string of text that will be shown to the user if the test failed.

A typical test file would be like this, that should be named something like "myCustomTest.py" and placed inside $USERAPPDATA/BIM/Preflight:

import FreeCAD

# The name of your test. You can give the functions any name
# you want, the important is the description text below

def myCustomTest():

   # This describes what your test does. For example,
   # here, it checks that there is at least one object in the document.
   # This text will appear next to the button in the Preflight tool

   """Checks that the document contains at least one object"""

   doc = FreeCAD.ActiveDocument
   objects = doc.Objects
   if len(objects) >= 1:
       result = True
   else:
       result = "This document contains no object"

   # The function must return either True or a string of
   # text if the test failed. The string or text will be displayed
   # to the user when they press the "Failed" button.

   return result