mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Assigning a parametric layer type (for walls for now) now attempts to switch from non parametric to parametric geometry.
This commit is contained in:
@@ -54,40 +54,16 @@ class Usecase:
|
||||
}
|
||||
)
|
||||
|
||||
ifcopenshell.api.run(
|
||||
"type.map_type_representations",
|
||||
self.file,
|
||||
related_object=self.settings["related_object"],
|
||||
relating_type=self.settings["relating_type"],
|
||||
)
|
||||
if self.settings["relating_type"].RepresentationMaps:
|
||||
ifcopenshell.api.run(
|
||||
"type.map_type_representations",
|
||||
self.file,
|
||||
related_object=self.settings["related_object"],
|
||||
relating_type=self.settings["relating_type"],
|
||||
)
|
||||
self.map_material_usages()
|
||||
return types
|
||||
|
||||
def map_representations(self):
|
||||
if not self.settings["relating_type"].RepresentationMaps:
|
||||
return
|
||||
representations = []
|
||||
if self.settings["related_object"].Representation:
|
||||
representations = self.settings["related_object"].Representation.Representations
|
||||
for representation in representations:
|
||||
# TODO: check if this is right? Surely this can be a single usecase?
|
||||
ifcopenshell.api.run(
|
||||
"geometry.unassign_representation",
|
||||
self.file,
|
||||
**{"product": self.settings["related_object"], "representation": representation}
|
||||
)
|
||||
ifcopenshell.api.run("geometry.remove_representation", self.file, **{"representation": representation})
|
||||
for representation_map in self.settings["relating_type"].RepresentationMaps:
|
||||
representation = representation_map.MappedRepresentation
|
||||
mapped_representation = ifcopenshell.api.run(
|
||||
"geometry.map_representation", self.file, **{"representation": representation}
|
||||
)
|
||||
ifcopenshell.api.run(
|
||||
"geometry.assign_representation",
|
||||
self.file,
|
||||
**{"product": self.settings["related_object"], "representation": mapped_representation}
|
||||
)
|
||||
|
||||
def map_material_usages(self):
|
||||
type_material = ifcopenshell.util.element.get_material(self.settings["relating_type"])
|
||||
if not type_material:
|
||||
|
||||
Reference in New Issue
Block a user