mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 16:29:57 +00:00
Maintain GlobalIds for projects and spatial structures
This commit is contained in:
@@ -266,7 +266,7 @@ class IfcParser():
|
|||||||
'ifc': None,
|
'ifc': None,
|
||||||
'raw': collection,
|
'raw': collection,
|
||||||
'class': self.get_ifc_class(collection.name),
|
'class': self.get_ifc_class(collection.name),
|
||||||
'attributes': { 'Name': self.get_ifc_name(collection.name) }
|
'attributes': self.get_object_attributes(collection)
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_libraries(self):
|
def get_libraries(self):
|
||||||
@@ -279,7 +279,7 @@ class IfcParser():
|
|||||||
'raw': collection,
|
'raw': collection,
|
||||||
'class': self.get_ifc_class(collection.name),
|
'class': self.get_ifc_class(collection.name),
|
||||||
'rel_declares_type_products': [],
|
'rel_declares_type_products': [],
|
||||||
'attributes': { 'Name': self.get_ifc_name(collection.name) }
|
'attributes': self.get_object_attributes(collection)
|
||||||
})
|
})
|
||||||
return results
|
return results
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ class IfcParser():
|
|||||||
'ifc': None,
|
'ifc': None,
|
||||||
'raw': collection,
|
'raw': collection,
|
||||||
'class': self.get_ifc_class(collection.name),
|
'class': self.get_ifc_class(collection.name),
|
||||||
'attributes': { 'Name': self.get_ifc_name(collection.name)}
|
'attributes': self.get_object_attributes(collection)
|
||||||
})
|
})
|
||||||
return elements
|
return elements
|
||||||
|
|
||||||
@@ -564,7 +564,6 @@ class IfcExporter():
|
|||||||
|
|
||||||
def create_project(self):
|
def create_project(self):
|
||||||
self.ifc_parser.project['attributes'].update({
|
self.ifc_parser.project['attributes'].update({
|
||||||
'GlobalId': ifcopenshell.guid.new(),
|
|
||||||
'RepresentationContexts': [self.ifc_rep_context],
|
'RepresentationContexts': [self.ifc_rep_context],
|
||||||
'UnitsInContext': self.file.by_type("IfcUnitAssignment")[0]
|
'UnitsInContext': self.file.by_type("IfcUnitAssignment")[0]
|
||||||
})
|
})
|
||||||
@@ -636,7 +635,6 @@ class IfcExporter():
|
|||||||
for node in element_tree:
|
for node in element_tree:
|
||||||
element = self.ifc_parser.spatial_structure_elements[node['reference']]
|
element = self.ifc_parser.spatial_structure_elements[node['reference']]
|
||||||
element['attributes'].update({
|
element['attributes'].update({
|
||||||
'GlobalId': ifcopenshell.guid.new(), # TODO: unhardcode
|
|
||||||
'OwnerHistory': self.owner_history, # TODO: unhardcode
|
'OwnerHistory': self.owner_history, # TODO: unhardcode
|
||||||
'ObjectPlacement': self.file.createIfcLocalPlacement(placement_rel_to, self.origin)
|
'ObjectPlacement': self.file.createIfcLocalPlacement(placement_rel_to, self.origin)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user