Skip to main content

Author: LanHao

Project description

copyifc

使用示例

import ifcopenshell
from ifcopenshell.file import file
from copyifc.copyifc import IDCache

ifc_file1 = ifcopenshell.open("test.ifc")

ifc_to = file()

comb = IDCache(ifc_to)
ins = ifc_file1.by_type("ifcroot")[0]  # 其他查询
ins_new = comb.recursion_copy(ins)

仅仅提供一个递归调用,复制传入的entity_instance以及该entity_instance 指向的其他entity_instance

通过原始文件的 globalid 映射目标文件中的entity_instance,防止重复复制。

同时在复制时修改globalid。

为何?

当我尝试使用ifcopenshell自带的add功能时,发现这么一个问题:

在复制不同的ifc文件中的部分对象到同一个ifc文件中去时,会出现一些显示异常。

通过分析,揣测是在复制过程中,部分globalid相同的entity_instance,被共用了,但其实两者可能不一样。

所以尝试自己通过递归手动复制来完成。

并且达到了自己的效果。

ifcopenshell 依赖

项目依赖于 aconda 中ifcopenshell 库,未曾在项目依赖中标注,因为pip 无法直接安装aconda的库.请自行安装.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

copyifc-0.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

copyifc-0.1.1-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file copyifc-0.1.1.tar.gz.

File metadata

  • Download URL: copyifc-0.1.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for copyifc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8a1b33a61b08c50c994dda352c68b7afd51f70cc89103904e667aeb67cd44f9f
MD5 a5722fa6f104fc5a6003a0db3fb9a51c
BLAKE2b-256 d2507396d04bcc89fdd1c9ca6929d5ddcd2d3fc9f162a9d9d17e0db97d161a71

See more details on using hashes here.

File details

Details for the file copyifc-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: copyifc-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for copyifc-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3a4fecafa3286a0a320761e49e4b6f6978032229fa2ebd4905b084c1972e4cd3
MD5 5efd2d219bf10a8489115e0805e0d5f9
BLAKE2b-256 d209c00cc60f22fff6968386d9846f68c9b73a456ce5e9feba4a7b98055d7c19

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page