파일 1안에 있는 객체1과 파일 2 안에 있는 객체2를 한개의 파일로 합치는 방법
import ifcopenshell
from ifcopenshell import geom
import sys
file1='file1.ifc'
file2='file2.ifc'
f1=ifcopenshell.open(file1)
f2=ifcopenshell.open(file2)
g=ifcopenshell.file(schema=f1.schema)
prjF1=f1.by_type('IfcProduct')[0]
prjF2=f2.by_type('IfcProduct')[0]
elemFromF1=f1.by_type('IfcBuildingElementProxy')[0] #IfcBuildingElementProxy <-복사하려는 객체의 타입
elemFromF2=f2.by_type('IfcBuildingElementProxy')[0]
elemFromF2.Representation.Location(10,0.0,0.0)
g.add(prjF1)
g.add(prjF2)
g.add(elemFromF1)
g.add(elemFromF2)
g.write('NewIFC.ifc') #새파일
'Python' 카테고리의 다른 글
Obj와 Ifc 파일이 회전 처리가 다른 이유 (0) | 2020.07.07 |
---|---|
IfcOpenShell Pyton으로 내부객체 이동 (0) | 2020.07.03 |
Python에서 IFC파일 컨트롤..(IfcOpenShell) (0) | 2020.07.01 |
ImportError: IfcOpenShell not built for 'windows\64bit\python3.7' IfcOpenShell pycharm 에러 (0) | 2020.06.17 |
obj to ifc는 불가능한것인가 (2) | 2020.04.14 |