mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 06:21:40 +00:00
Minor fix for IFC2X3
This commit is contained in:
@@ -640,7 +640,11 @@ class IfcParser():
|
|||||||
def get_classification_reference_maps(self):
|
def get_classification_reference_maps(self):
|
||||||
results = {}
|
results = {}
|
||||||
for filename, classification in self.classifications.items():
|
for filename, classification in self.classifications.items():
|
||||||
results[filename] = { e.Identification: e for e in schema.ifc.classification_files[filename].by_type('IfcClassificationReference')}
|
ifc_file = schema.ifc.classification_files[filename]
|
||||||
|
if ifc_file.schema == 'IFC2X3':
|
||||||
|
results[filename] = { e.ItemReference: e for e in ifc_file.by_type('IfcClassificationReference')}
|
||||||
|
else:
|
||||||
|
results[filename] = { e.Identification: e for e in ifc_file.by_type('IfcClassificationReference')}
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def get_classification_references(self):
|
def get_classification_references(self):
|
||||||
@@ -1104,9 +1108,10 @@ class IfcExporter():
|
|||||||
self.ifc_export_settings = ifc_export_settings
|
self.ifc_export_settings = ifc_export_settings
|
||||||
self.ifc_parser = ifc_parser
|
self.ifc_parser = ifc_parser
|
||||||
self.qto_calculator = qto_calculator
|
self.qto_calculator = qto_calculator
|
||||||
|
self.schema = 'IFC4'
|
||||||
|
|
||||||
def export(self, selected_objects):
|
def export(self, selected_objects):
|
||||||
self.file = ifcopenshell.open(self.template_file)
|
self.file = ifcopenshell.file(schema=self.schema)
|
||||||
self.ifc_parser.parse(selected_objects)
|
self.ifc_parser.parse(selected_objects)
|
||||||
self.create_units()
|
self.create_units()
|
||||||
self.create_people()
|
self.create_people()
|
||||||
|
|||||||
@@ -2530,6 +2530,8 @@ class PushRepresentation(bpy.types.Operator):
|
|||||||
|
|
||||||
# Warning: This is an incredibly experimental operator.
|
# Warning: This is an incredibly experimental operator.
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
self.file = ifc.IfcStore.get_file()
|
||||||
|
|
||||||
logger = logging.getLogger('ExportIFC')
|
logger = logging.getLogger('ExportIFC')
|
||||||
output_file = 'tmp.ifc'
|
output_file = 'tmp.ifc'
|
||||||
ifc_export_settings = export_ifc.IfcExportSettings.factory(context, output_file, logger)
|
ifc_export_settings = export_ifc.IfcExportSettings.factory(context, output_file, logger)
|
||||||
@@ -2537,13 +2539,12 @@ class PushRepresentation(bpy.types.Operator):
|
|||||||
ifc_parser.parse([bpy.context.active_object])
|
ifc_parser.parse([bpy.context.active_object])
|
||||||
qto_calculator = export_ifc.QtoCalculator()
|
qto_calculator = export_ifc.QtoCalculator()
|
||||||
self.ifc_exporter = export_ifc.IfcExporter(ifc_export_settings, ifc_parser, qto_calculator)
|
self.ifc_exporter = export_ifc.IfcExporter(ifc_export_settings, ifc_parser, qto_calculator)
|
||||||
self.ifc_exporter.file = ifcopenshell.open(self.ifc_exporter.template_file)
|
self.ifc_exporter.file = ifcopenshell.file(schema=self.file.schema)
|
||||||
self.ifc_exporter.create_origin()
|
self.ifc_exporter.create_origin()
|
||||||
self.ifc_exporter.create_rep_context()
|
self.ifc_exporter.create_rep_context()
|
||||||
self.ifc_exporter.create_representations()
|
self.ifc_exporter.create_representations()
|
||||||
|
|
||||||
self.context, self.subcontext, self.target_view, self.mesh_name = bpy.context.active_object.data.name.split('/')
|
self.context, self.subcontext, self.target_view, self.mesh_name = bpy.context.active_object.data.name.split('/')
|
||||||
self.file = ifc.IfcStore.get_file()
|
|
||||||
rep_context = self.get_geometric_representation_context()
|
rep_context = self.get_geometric_representation_context()
|
||||||
|
|
||||||
for key, rep in self.ifc_exporter.ifc_parser.representations.items():
|
for key, rep in self.ifc_exporter.ifc_parser.representations.items():
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ class IfcSchema():
|
|||||||
|
|
||||||
def get_classification_references(self, classification):
|
def get_classification_references(self, classification):
|
||||||
references = {}
|
references = {}
|
||||||
if not classification.HasReferences:
|
if not hasattr(classification, 'HasReferences') \
|
||||||
|
or not classification.HasReferences:
|
||||||
return references
|
return references
|
||||||
for reference in classification.HasReferences:
|
for reference in classification.HasReferences:
|
||||||
references[reference.Identification] = {
|
references[reference.Identification] = {
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
ISO-10303-21;
|
|
||||||
HEADER;
|
|
||||||
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
|
|
||||||
FILE_NAME('$filename','2019-05-12T12:33:45',('$owner','$email'),('$company'),'IfcOpenShell','IfcOpenShell','');
|
|
||||||
FILE_SCHEMA(('IFC4'));
|
|
||||||
ENDSEC;
|
|
||||||
DATA;
|
|
||||||
ENDSEC;
|
|
||||||
END-ISO-10303-21;
|
|
||||||
Reference in New Issue
Block a user