mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
@@ -17,6 +17,7 @@
|
|||||||
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
|
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
import ifcopenshell.util.element
|
||||||
import ifcopenshell.util.system
|
import ifcopenshell.util.system
|
||||||
import blenderbim.core.tool
|
import blenderbim.core.tool
|
||||||
import blenderbim.tool as tool
|
import blenderbim.tool as tool
|
||||||
@@ -145,7 +146,7 @@ class System(blenderbim.core.tool.System):
|
|||||||
new.ifc_class = system.is_a()
|
new.ifc_class = system.is_a()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load_ports(cls, element, ports):
|
def load_ports(cls, element: ifcopenshell.entity_instance, ports: list[ifcopenshell.entity_instance]) -> None:
|
||||||
if not ports:
|
if not ports:
|
||||||
return
|
return
|
||||||
obj = tool.Ifc.get_object(element)
|
obj = tool.Ifc.get_object(element)
|
||||||
@@ -155,7 +156,13 @@ class System(blenderbim.core.tool.System):
|
|||||||
ifc_importer.calculate_unit_scale()
|
ifc_importer.calculate_unit_scale()
|
||||||
ifc_importer.process_context_filter()
|
ifc_importer.process_context_filter()
|
||||||
ifc_importer.create_generic_elements(set(ports))
|
ifc_importer.create_generic_elements(set(ports))
|
||||||
|
|
||||||
|
container = ifcopenshell.util.element.get_container(element)
|
||||||
|
if container:
|
||||||
|
collection = tool.Ifc.get_object(container).BIMObjectProperties.collection
|
||||||
|
ifc_importer.collections[container.GlobalId] = collection
|
||||||
ifc_importer.place_objects_in_collections()
|
ifc_importer.place_objects_in_collections()
|
||||||
|
|
||||||
for port_obj in ifc_importer.added_data.values():
|
for port_obj in ifc_importer.added_data.values():
|
||||||
port_obj.parent = obj
|
port_obj.parent = obj
|
||||||
port_obj.matrix_parent_inverse = obj.matrix_world.inverted()
|
port_obj.matrix_parent_inverse = obj.matrix_world.inverted()
|
||||||
|
|||||||
Reference in New Issue
Block a user