Skip to content

How can I move all the elements that are in the wall when the wall moves? #3191

@Theinformatiker

Description

@Theinformatiker

Is it possible if I have created the wall with an opening element and placed a fixed one there, so that when I move the wall the window also moves. At the moment only the wall with its opening is moved. I use the python api for this, but it would also be interesting to know the whole thing for c++ :-).

        # moves the wall into the edit position for create  opening and window
        run("geometry.edit_object_placement", model, product=wall, matrix=MatOrgin)
        # crate opening
        op = run("root.create_entity", self.model, ifc_class="IfcOpeningElement")
        # crate geometrie
        repsOp = run("geometry.add_wall_representation", model, context=sbody,
                     length=length, height=height, thickness=thickness)
        run("geometry.assign_representation", model, product=op, representation=repsOp)
        matrix = np.identity(4)
        matrix[:, 3] = [x, y, z, 0]

        run("geometry.edit_object_placement", model, product=opening, matrix=matrix)
        # The opening will now void the wall.
        run("void.add_opening", model, opening=opening, element=wall)
        win = run("root.create_entity", model, ifc_class="IfcWindow", name="Window")

        repsWin1 = run("geometry.add_wall_representation", model, context=body,
                       length=length, height=height, thickness=thickness)

        run("geometry.assign_representation", model, product=win, representation=repsWin1)
        run("geometry.edit_object_placement", model, product=win, matrix=matrix)

        # moves the wall into the right position
        run("geometry.edit_object_placement", model, product=wall, matrix=wallMat, should_transform_children=True)

If I move the wall back to its correct position at the end, the window still remains in the old position.
How can I solve the problem even if I move the wall in Blender the same problem occurs?

image

In Blender there is a relation where you can assign the window to the wall.
Isn't there something like that in the Ifcopenshell too?

Thank you for your time and attention.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions