Fix #4921. When upgrading to IFC4X3, preprocess the file to remove deprecated style assignments

This commit is contained in:
Dion Moult
2024-06-27 11:49:00 +10:00
parent 98afb72ba3
commit 48d058a32a
4 changed files with 18 additions and 3 deletions
@@ -48,6 +48,8 @@ class GeoreferenceData:
@classmethod
def coordinate_operation_class(cls):
if tool.Ifc.get_schema() == "IFC2X3":
return []
declaration = tool.Ifc.schema().declaration_by_name("IfcCoordinateOperation")
declarations = ifcopenshell.util.schema.get_subtypes(declaration)
names = [d.name() for d in declarations]
-3
View File
@@ -16,11 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import os
import bpy
import ifcopenshell
import blenderbim.core.tool
import blenderbim.tool as tool
try:
import ifcpatch
@@ -31,6 +29,5 @@ except:
class Patch(blenderbim.core.tool.Patch):
@classmethod
def run_migrate_patch(cls, infile, outfile, schema):
log = os.path.join(bpy.context.scene.BIMProperties.data_dir, "process.log")
output = ifcpatch.execute({"input": infile, "file": ifcopenshell.open(infile), "recipe": "Migrate", "arguments": [schema]})
ifcpatch.write(output, outfile)