mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 11:43:53 +00:00
Fix #1071. New IFC file version 2X3<->4 upgrader and downgrader IfcPatch recipe
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.schema
|
||||
|
||||
|
||||
class Patcher:
|
||||
def __init__(self, src, file, logger, args=None):
|
||||
self.src = src
|
||||
self.file = file
|
||||
self.logger = logger
|
||||
self.args = args
|
||||
|
||||
def patch(self):
|
||||
self.new = ifcopenshell.file(schema=self.args[0])
|
||||
migrator = ifcopenshell.util.schema.Migrator()
|
||||
for element in self.file:
|
||||
print("Migrating", element)
|
||||
print("Successfully converted to", migrator.migrate(element, self.new))
|
||||
self.file = self.new
|
||||
Reference in New Issue
Block a user