Skip to content

Commit 62fa0bb

Browse files
committed
Migrate more documentation to the official Sphinx docs and mention IfcOpenShell-WASM as an installation option
1 parent 9e67565 commit 62fa0bb

11 files changed

Lines changed: 107 additions & 147 deletions

File tree

src/bcf/README.md

Lines changed: 3 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,5 @@
11
# bcf
22

3-
A simple Python implementation of BCF.
4-
Manipulation of BCF-XML is available via `bcfxml.py` and manipulation of BCF-API
5-
is available via `bcfapi.py`.
6-
7-
It tries to support BCF-XML version 2.1 and 3.0, and BCF-API 3.0.
8-
9-
## bcfxml
10-
11-
The `bcfxml.load` function lets you read a BCF-XML file.
12-
It takes care of using the right version based on the "bcf.version" file contained in the BCF package.
13-
14-
The BCF files are extracted and parsed on-demand, and edits are stored in memory until you call the `save` method.
15-
16-
```python
17-
from bcf.bcfxml import load
18-
19-
# Load a project
20-
with load("/path/to/file.bcf") as bcfxml:
21-
project = bcfxml.project
22-
print(project.name)
23-
24-
# To edit a project, just modify the object directly
25-
bcfxml.project.name = "New name"
26-
27-
# Get a dictionary of topics
28-
topics = bcfxml.topics
29-
30-
for topic_guid, topic_handler in bcfxml.topics.items():
31-
topic = topic_handler.topic
32-
print("Topic guid is", topic.guid)
33-
print("Topic title is", topic.title)
34-
35-
# Fetch extra data about a topic
36-
header = topic_handler.header
37-
comments = topic_handler.comments
38-
viewpoints = topic_handler.viewpoints
39-
40-
for comment in comments:
41-
print(comment.guid)
42-
print(comment.comment)
43-
print(comment.author)
44-
45-
# Get a particular topic
46-
topic = bcfxml.get_topic(guid)
47-
48-
# Modify a topic
49-
topic.title = "New title"
50-
51-
bcfxml.save()
52-
```
53-
54-
## bcfapi
55-
56-
The `bcfapi` module lets you interact with the BCF-API standard.
57-
58-
```python
59-
from bcf.v3.bcfapi import FoundationClient, BcfClient
60-
61-
foundation_client = FoundationClient("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET", "OPENCDE_BASEURL")
62-
auth_methods = foundation_client.get_auth_methods()
63-
64-
# Our library currently only implements the authorization_code flow
65-
if "authorization_code" in auth_methods:
66-
foundation_client.login()
67-
68-
bcf_client = BcfClient(foundation_client)
69-
70-
versions = foundation_client.get_versions()
71-
for version in versions:
72-
if "3.0" in versions:
73-
if version["api_id"] == "bcf" and version["version_id"] == "3.0":
74-
bcf_client.set_version(version)
75-
76-
data = bcf_client.get_projects()
77-
print(data)
78-
project_id = data[0]["project_id"]
79-
print(project_id)
80-
data = bcf_client.get_project(project_id)
81-
print(data)
82-
data = bcf_client.get_extensions(project_id)
83-
print(data)
84-
```
3+
A simple Python implementation of the BCF standard. Manipulation of BCF-XML is
4+
available via `bcfxml.py` and manipulation of BCF-API is available via
5+
`bcfapi.py`.

src/bsdd/README.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
11
# bsdd
22

3-
An experimental work in progress library to interact with the buildingSMART Data Dictionary (bSDD) API.
4-
5-
More reading:
6-
7-
* [Swagger API docs](https://bs-dd-api-prototype.azurewebsites.net/swagger/index.html)
8-
* [bSDD Github Repository](https://github.com/buildingSMART/bSDD)
9-
10-
# Demo
11-
12-
Let's replicate the SketchUp example:
13-
14-
```
15-
client = Client()
16-
pprint(client.Domain())
17-
pprint(client.SearchListOpen("http://identifier.buildingsmart.org/uri/nlsfb/nlsfb2005-2.2", RelatedIfcEntity="IfcWall"))
18-
data = client.Classification("http://identifier.buildingsmart.org/uri/nlsfb/nlsfb2005-2.2/class/21.21")
19-
pprint(data)
20-
apply_ifc_classification_properties(ifc_file, element, data["classificationProperties"])
21-
```
3+
A library to interact with the buildingSMART Data Dictionary (bSDD) API.
Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
BIMServer-Plugin
22
================
33

4-
This documentation is free software! You are free to contribute and help write
5-
this document.
6-
7-
.. toctree::
8-
:maxdepth: 1
9-
:caption: Contents:
10-
11-
Indices and tables
12-
------------------
13-
14-
* :ref:`genindex`
15-
* :ref:`modindex`
16-
* :ref:`search`
4+
The BIMServer-Plugin is a plugin to the open source BIMServer CDE to allow you
5+
to use IfcOpenShell to parse, view, and audit models.
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
BIMTester
22
=========
33

4-
This documentation is free software! You are free to contribute and help write
5-
this document.
6-
7-
.. toctree::
8-
:maxdepth: 1
9-
:caption: Contents:
10-
11-
Indices and tables
12-
------------------
13-
14-
* :ref:`genindex`
15-
* :ref:`modindex`
16-
* :ref:`search`
4+
BIMTester is a utility that allows you to write Gherkin-based tests for models.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
bSDD
2+
====
3+
4+
The **buildingSMART Data Dictionary** (bSDD) is an online RESTful centralised
5+
API provided by buildingSMART that allows you to search for standardised
6+
classifications and properties.
7+
8+
For example, if you want to assign a Uniclass classification system (popular in
9+
the UK) or an Omniclass classification system (popular in the US) to elements
10+
in your model, instead of downloading the classification system from their
11+
website, you can directly search the bSDD. This ensures that you are always up
12+
to date, and that codes are entered correctly (without spelling mistakes,
13+
correct formatting, etc).
14+
15+
The bSDD search results may also be filtered based on IFC class. This will make
16+
it quick to shortlist relevant classification codes and properties to a
17+
particular object.
18+
19+
The bSDD also stores information on whether or not classification systems
20+
require additional standard properties to be filled out, and whether they
21+
should be filled out in a particular way. For example, all countries need to
22+
fill out a "Fire Rating" property for walls, but they have different ways to
23+
fill it out. Local governments (or companies) may submit their standard to the
24+
bSDD so that all bSDD-compatible BIM applications can look up the property and
25+
fill it out in a standardised way (such as picking for a list of preset
26+
possible values defined by the local government).
27+
28+
More reading:
29+
30+
1. `Swagger API docs <https://bs-dd-api-prototype.azurewebsites.net/swagger/index.html>`_
31+
2. `bSDD Github Repository <https://github.com/buildingSMART/bSDD>`_
32+
33+
Examples
34+
--------
35+
36+
Learning how to use the bSDD is best done by reading the official Swagger API docs.
37+
38+
.. code-block:: python
39+
40+
client = Client()
41+
42+
# Get a list of "dictionary domains". For example, Uniclass (by the NBS organisation) might be one domain.
43+
print(client.Domain())
44+
45+
# For example, search the Netherland's Nlsfb2005 classification standard for all codes that apply to an IfcWall.
46+
print(client.SearchListOpen("http://identifier.buildingsmart.org/uri/nlsfb/nlsfb2005-2.2", RelatedIfcEntity="IfcWall"))
47+
48+
# Alternatively, search up a particular classification code.
49+
data = client.Classification("http://identifier.buildingsmart.org/uri/nlsfb/nlsfb2005-2.2/class/21.21")
50+
print(data)
51+
52+
# You may also apply default properties (if the classification system on
53+
# the bSDD defines them) to your IFC element. For example, if a
54+
# classification code is for a load bearing wall, it can automatically set
55+
# the "LoadBearing" property to True for you.
56+
apply_ifc_classification_properties(ifc_file, element, data["classificationProperties"])

src/ifcopenshell-python/docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767

6868
# autoapi works by reading source code instead of importing modules
6969
autoapi_dirs = ['../ifcopenshell', '../../ifcdiff', '../../ifcpatch/ifcpatch']
70+
autoapi_dirs = ['../../ifcdiff', '../../ifcpatch/ifcpatch']
7071

7172
# These are auto-generated based on the IFC schema, so exclude them
7273
autoapi_ignore = ['*ifcopenshell/express/rules*']

src/ifcopenshell-python/docs/ifccobie.rst

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
IfcFM
2+
=====
3+
4+
IfcFM is a utility to
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
IfcMax
2+
======
3+
4+
IfcMax is a 3ds Max importer plugin able to import the IFC file format.
5+
6+
Community builds are available for 3ds Max by Josef Wienerroither (also known
7+
as ``FrogsInSpace`` or ``spacefrog``). Builds are available for IfcOpenShell
8+
v0.7.0 for 3ds Max version 2020-2024. Older builds are also available for
9+
IfcOpenShell v0.6.0 for 3ds Max version 2015-2022.
10+
11+
It is recommended to use the latest version of IfcOpenShell and 3ds Max.
12+
13+
- `Visit FrogsInSpace official website for IfcMax <https://www.frogsinspace.at/?p=3454>`__.
14+
- `Download IfcMax plugins <https://github.com/FrogsInSpace/IfcOpenShell/releases>`__.
15+
16+
.. note::
17+
18+
This plugin is purely an importer and does not handle native IFC authoring
19+
or exporting. For more information for native IFC authoring, we recommend
20+
using the :doc:`BlenderBIM Add-on<blenderbim>`.

src/ifcopenshell-python/docs/ifcopenshell-python/installation.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ packages**. If you aren't a programmer, go for the **BlenderBIM Add-on**.
1111
4. **Docker** is recommended for developers using Docker.
1212
5. **AWS Lambda** is recommended for developers using AWS Lambda functions.
1313
6. **Google Colab** is recommended for developers using Google Colab.
14-
7. **Using the BlenderBIM Add-on** is recommended for non-developers wanting a graphical interface.
15-
8. **From source with precompiled binaries** is recommended for developers actively working with the Python code.
16-
9. **Compiling from source** is recommended for developers actively working with the C++ core.
14+
7. **Web Assembly** is recommended for developers experimenting with IfcOpenShell on the web.
15+
8. **Using the BlenderBIM Add-on** is recommended for non-developers wanting a graphical interface.
16+
9. **From source with precompiled binaries** is recommended for developers actively working with the Python code.
17+
10. **Compiling from source** is recommended for developers actively working with the C++ core.
1718

1819
Pre-built packages
1920
------------------
@@ -197,6 +198,17 @@ local system.
197198
<https://colab.research.google.com/drive/1S9uZQvqXRpF1z6JTiKk79M1Ln63rHHIZ?usp=sharing>`__
198199
to launch a simple notebook.
199200

201+
Web Assembly
202+
------------
203+
204+
IfcOpenShell is available as technology preview to be run using WASM. This
205+
allows you to run IfcOpenShell in a browser using pyodide. This implementation
206+
is incredibly heavy and will incur a long load time, but once loaded, will give
207+
you full access to the entire IfcOpenShell API.
208+
209+
`Click here <https://github.com/IfcOpenShell/wasm-preview>`__ to learn how to
210+
use WASM.
211+
200212
Using the BlenderBIM Add-on
201213
---------------------------
202214

0 commit comments

Comments
 (0)