Files
IfcOpenShell/src/ifctester/README.md
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.2 KiB
Markdown
Raw Normal View History

# ifctester
2022-10-30 23:16:08 +01:00
With **IfcTester**, you can author and read **Information Delivery Specification** - **IDS** - files and validate your IFC models against IDS to see if your model is compliant. After the audit, you can generate reports in console, as a web page, JSON or BCF file. It works from the command line, as a web app, or as a library.
## How to use it
2023-03-17 08:04:56 +00:00
```python
import ifcopenshell
from ifctester import ids, reporter
2022-10-30 23:16:08 +01:00
# create new IDS
my_ids = ids.Ids(title="My IDS")
# add specification to it
my_spec = ids.Specification(name="My first specification")
my_spec.applicability.append(ids.Entity(name="IFCWALL"))
property = ids.Property(
2024-03-28 22:47:48 +11:00
baseName="IsExternal",
2022-10-30 23:16:08 +01:00
value="TRUE",
propertySet="Pset_WallCommon",
2024-03-28 22:47:48 +11:00
dataType="IfcBoolean",
2022-10-30 23:16:08 +01:00
uri="https://identifier.buildingsmart.org/uri/.../prop/LoadBearing",
2023-06-15 20:04:16 +02:00
instructions="Walls need to be load bearing.",
2024-03-28 22:47:48 +11:00
cardinality="required")
2022-10-30 23:16:08 +01:00
my_spec.requirements.append(property)
my_ids.specifications.append(my_spec)
# Save such IDS to file
result = my_ids.to_xml("SampleIDS.xml")
# open IFC file:
my_ifc = ifcopenshell.open("MyIfcModel.ifc")
# validate IFC model against IDS requirements:
my_ids.validate(my_ifc)
# show results:
reporter.Console(my_ids).report()
2023-03-17 08:04:56 +00:00
```