LoginSignup
3
2

More than 1 year has passed since last update.

ifcOpenShell python のインストール方法

Last updated at Posted at 2022-07-23

最近騒がれている BIM/CIM ですが、共通フォーマットの .ifc ファイルを扱わなければいけません
今回は python から ifc ファイルを扱うためのモジュール ifcOpenShell を 自分の環境にインストールする方法をメモしておきます

ifcOpenShell python のインストール

Step1 自分の環境を調べる

① python のバージョンを調べる

> python --version
Python 3.x.xx

② python のインストールフォルダを調べる

> python
>>> import sys
>>> sys.exec_prefix
'C:/Users/〇/〇'

③ ②のフォルダに site-packages フォルダ が存在することを確認する

例)C:/Users/〇/〇/Lib/site-packages

Step2 ifcOpenShellファイルを自分の環境にコピーする

④ gitHub から ifcOpenShell のビルドを取得する

ここから のpythonバージョン にあった .zip をダウンロード

例) blenderbim-220722-py39-win.zip

⑤ ④の .zip を解答し以下のフォルダ/ファイルを③にコピー

  • blenderbim-〇〇-win.zip/blenderbim/libs/site/packages/..
    • cjio (フォルダ)
    • ifc4d (フォルダ)
    • ifc5d (フォルダ)
    • ifcopenshell (フォルダ)
    • cobie.py
    • ifccsv.py
    • get_maintainable_assets.py

参考サイト

https://www.youtube.com/watch?v=1g_nrGQO9Kc

ifcOpenShell python のテスト

テストコード

import ifcopenshell
from ifcopenshell import geom
ifc_path = "ifcファイルの名前"

ifc_file = ifcopenshell.open(ifc_path)
#settings = geom.settings()

wall = ifc_file.by_type("IfcWall")[0]

wall.Name

'Wall'

いけたっぽい

参考サイト

http://blog.livedoor.jp/motoiyamaha/archives/51816543.html

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2