BlenderBIM: Arrays, IfcRelAggregates, IfcOpeningElements, IfcMaterials

edited April 2023 in General

I have the following use-case:

1. Creating an IfcRelAggregate out of an IFC Array:

I have used the IfcRelAggregate tool to make them into one IfcElementAssembly

With the next Save Project four IfcBeams appeared, I've seen this in BIMVision

Closing Blender and importing the IFC again, to get rid of the excessive IFC Beams, it worked:

 

Is it possible there could be a checkbox button in which you could say the Array is by defintion already going to be an IfcRelAggregate? This will save me from trying to select the items I want in the Scene Collection or 3D view and it would be easier to create IfcElementAssemblies out of various IfcElementAssemblies.
 

2. Adding an IfcOpening to an IfcElementAssembly:

Now I have added an IfcOpeningElement to the IfcElementAssembly,
as you can see it cuts nicely through the IfcSlabs and IfcBeam:

IFC save worked perfect:

This is not alway the case, sometimes it has troubles cutting through all the geometry. But I can't reproduce it...
 

3. Question about materials:


In the Demo library the IfcSlab and IfcBeam are made with an IfcProfile which have an Unknown material.
If I remove this material and make new material called my_material. I have to assign the material to one instance of an IfcBeam under profile and it will update all the beamtype instances.

With succesful IFC save.

This is the correct worflow of swapping materials, or only for materials needed by profiles?
 

4. How to use python to create an IfcElementAssembly?

I have this code snippet

    def create_assembly(self, model, element_list):
        assembled_element = run("root.create_entity", model, ifc_class="IfcElementAssembly",name='my_collection')
        for i in element_list:
            run("aggregate.assign_object", model, product=assembled_element, relating_object=i)

element_list looks like this:

[#202=IfcCovering('3Qn21p1p5EL8y2qdjXrWg6',$,'insulation',$,$,#223,#213,$,$), #225=IfcCovering('0Z7y9GduPDkwEkOkhAzED6',$,'insulation',$,$,#246,#236,$,$), #248=IfcCovering('1A4n9VM5XD9fjZdtJ3lhFj',$,'insulation',$,$,#269,#259,$,$), #271=IfcCovering('1AIix1i916xBNV_TOWHCGx',$,'insulation',$,$,#292,#282,$,$), #294=IfcCovering('1N65f0cKf1cwFvuV8H7Tfk',$,'insulation',$,$,#315,#305,$,$), #346=IfcCovering('2eeTeOBmX7_eobur6$sl4W',$,'insulation',$,$,#367,#357,$,$), #38=IfcMember('1yqJ4GTn5AqeX2x3ju6l9F',$,'my_beam',$,$,#56,#57,$,$), #59=IfcMember('3ZKjHPpWb8V8WLMu1qE1uw',$,'my_beam',$,$,#76,#77,$,$), #79=IfcMember('0UH0M7Iiv6yvCU3PosVy7I',$,'my_beam',$,$,#96,#97,$,$), #99=IfcMember('2qt0xIrZPCm8CeqKBcgchd',$,'my_beam',$,$,#116,#117,$,$), #119=IfcMember('1dRfBa9zLAlu05ax4a_3Mv',$,'my_beam',$,$,#136,#137,$,$), #139=IfcMember('3pkeFk8zH7W9h0uHP9Pl2w',$,'my_beam',$,$,#156,#157,$,$), #159=IfcMember('1_LmUDkbHAAgr$DQ4Yv$D0',$,'my_beam',$,$,#176,#177,$,$), #179=IfcBeam('0j7rHy9OnBvAB9vMKrg2oj',$,'my_beam',$,$,#196,#197,$,$)]

When I load the IFC in BlenderBIM I see on the last item of the list is added to the collection. Or the Collection takes the name from the last IfcElement in the list. Don't really understand why.
 

5. Duplicating an IfcElementAssembly

How to duplicate an IfcElementAssembly while it could also store the IFC array modfiers of the different element in the IfcElementAssembly?
 

Attached is the IFC.

All this functionality is very incredible by the way, it allows for such fast workflows.

Arvtheoryshaw
«134

Comments

  • Is it possible there could be a checkbox button in which you could say the Array is by defintion already going to be an IfcRelAggregate?

    I think this is a great idea. It seems arrays should automatically default to aggregates. Would think this would the use case majority of the times, anyway.

  • edited April 2023

    As far as I understand, it would be possible to define arrays to be aggregates (I will play with this later). But I was also thinking that would be nice to apply an array to an assembly. This would be harder because IfcElementAssembly are empty objects in blender, and modifiers can't be used in them. So I wouldn't know where to start.

    What I was able to create was an operator to duplicate assemblies, basically you have to select the empty that represents the IfcElementAssembly, and it duplicates all the related elements and create a new aggregation. The code is very simple, and I created it just as a test, but I think it works. It can be useful in some use cases (I saw this in another discussion, which I couldn't find). Thoughts?

    Coen
  • @bruno_perdigao my thought was that when you duplicate like this, all the copies could be put in an IfcGroup with an epset that declares something like "all children of this group should be the same".

    This wouldn't stop the user editing one of them and making it different, but then there could be a new operator for "update all other items in this group to be the same as the selected item".

    This would allow an IFC project to contain things that are intended to be identical (eg. the entire aggregated contents of building storeys), and provide a mechanism for keeping them synchronised.

    (The update operator could initially be a crude 'delete everything and replace' function, but ultimately a refined Native IFC version would recurse through the children and only change things that are actually different)

    CoentheoryshawtlangArv
  • I think a perfect use case for this would be a framed wall with several openings?

  • @coen you should be able to do this with existing functionality: Create your framing with typed studs, either by simply copying them or using the array modifier, put them in a 'wall' aggregate along with your boarding, cladding, skirting etc.. then add your openings to the wall aggregate object.

  • @brunopostle said:
    @coen you should be able to do this with existing functionality: Create your framing with typed studs, either by simply copying them or using the array modifier, put them in a 'wall' aggregate along with your boarding, cladding, skirting etc.. then add your openings to the wall aggregate object.

    This wouldn't stop the user editing one of them and making it different, but then there could be a new operator for "update all other items in this group to be the same as the selected item".

    This would allow an IFC project to contain things that are intended to be identical (eg. the entire aggregated contents of building storeys), and provide a mechanism for keeping them synchronised.

    I'm definitly going to try, since there is no IfcOpeningElementType? I wonder if this could be a workaround to 'type' IfcOpenings?

  • @Coen it might if it was implemented.

    Do you have a need for typed openings independent of fillings (windows & doors)? The current blenderbim shares the geometry for openings when they are filled by typed window/doors, I think.

    Coen
  • The current blenderbim shares the geometry for openings when they are filled by typed window/doors, I think.

    I see, how does this work? Does it cut the blender geometry? or does it also work with an IfcOpeningElement? What if you want to swap an entire window for another?

  • @coen (I may be wrong and may be unwittingly spreading disinformation) if you add a window to a wall using a window type, an opening is generated, either from the bounding box of the window or by extruding the Profile representation if it has one. If you create another window of this type, the mapped geometry of the first opening is reused for the second opening.

    This new opening geometry is shared, if you edit one then they all change. This is what you are after, but blenderbim doesn't have a way to pull this trick without filling the opening with a window or door.

  • @bruno_perdigao my thought was that when you duplicate like this, all the copies could be put in an IfcGroup with an epset that declares something like "all children of this group should be the same".

    This wouldn't stop the user editing one of them and making it different, but then there could be a new operator for "update all other items in this group to be the same as the selected item".

    This would allow an IFC project to contain things that are intended to be identical (eg. the entire aggregated contents of building storeys), and provide a mechanism for keeping them synchronised.

    (The update operator could initially be a crude 'delete everything and replace' function, but ultimately a refined Native IFC version would recurse through the children and only change things that are actually different)

    There are a few ideas from the IfcArray that I think can be adapted to your idea. I'm definitely going to try this. Maybe the editing and deleting of the children should only be possible when breaking the link, as I suggest here: https://github.com/IfcOpenShell/IfcOpenShell/issues/3063

    Coen
  • Some progress:

    And it seems to be working in other viewers:

    theoryshawCoencarlopavArv
  • edited April 2023

    There is no array yet, the assemblies are manually duplicated. But I think the only reason why the array is not possible in assembly elements is because the array UI is stored inside blender's modifiers panel, and blender hides them when an empty object is selected. IFC-wise, it seems to be possible to store BB array properties in an empty IfcElementAssembly.

    RaphaëlVouilloz
  • @bruno_perdigao said:
    Some progress:

    And it seems to be working in other viewers:

    YES!!! :-D

    bruno_perdigaocarlopav
  • @bruno_perdigao Is it possible to play around with your aggregate type script?
    I'm looking to design a pocket neighborhood with repeating dwelling units like below.
    File so far: https://gitlab.com/openingdesign/highland_haven/-/tree/77c1ace46920f08b1718b103556709bea906ecfd/Models and CAD

    Ace
  • @theoryshaw I'm not sure how to make it available. I couldn't create a working ".zip". If someone can point me how to do it, I'll be glad to.
    Anyway, here is the branch where I'm working on: https://github.com/brunoperdigao/IfcOpenShell/commits/duplicate-assembly, maybe you can copy the two files that have changes.
    About the functionality, this is how it works:

    • Once you have all the elements in one assembly, you have to select only the empty that has the IfcElementAssembly class. Then press "ctrl+F"* to duplicate, and you will be able to move the new copy.
    • When you want to make a change, you have to work on the original assembly.
    • To sync them, select only the empty from the original assembly, then "F3" and "IFC Refresh Aggregate"

    Keep in mind that it deletes and recreates all the elements, so I don't know how it will perform with a lot of elements. Let me know your thoughts on how it should work. There are a lot of other things to be implemented after this to create a good UX.

    theoryshawCoenAce
  • @bruno_perdigao

    Keep in mind that it deletes and recreates all the elements, so I don't know how it will perform with a lot of elements.


    Seems to work fine so far. I've IFC arrayed an entire cladding 😅

    Acebruno_perdigao
  • edited May 2023

    Let me know your thoughts on how it should work.

    Love it! Any chance to accommodate rotation? :)
    https://www.dropbox.com/s/kcxmumopveornpk/2023-05-02_10-48-45_Blender_blender.mp4?dl=0

  • @theoryshaw said:

    Let me know your thoughts on how it should work.

    Love it! Any chance to accommodate rotation? :)
    https://www.dropbox.com/s/kcxmumopveornpk/2023-05-02_10-48-45_Blender_blender.mp4?dl=0

    It definitely should. I messed up some of the matrix operations, but I'll take a look at that.

  • @theoryshaw Just pushed a new commit that fixes the rotation. It should be working now

    theoryshaw
  • I feel something like the following, would help greatly when working with aggregates...
    https://github.com/IfcOpenShell/IfcOpenShell/issues/3101

    bruno_perdigao
  • @theoryshaw said:
    I feel something like the following, would help greatly when working with aggregates...
    https://github.com/IfcOpenShell/IfcOpenShell/issues/3101

    I agree, also would be nice if there is an option where you could go back to selection of previous selected items. So you don't have to scroll through the entire Blender Scene collection to find the assembly which has the openings. I would think a clipboard like Windows has, for when you press Windows key + V. All your previous copied pasted items are in there, something similar with the last 10 selected previous items in a pop up menu. Just brainstorming... Maybe you have a better idea.

    bruno_perdigao
  • edited May 2023

    Possible to duplicate an aggregate within an aggregate? :)
    https://www.dropbox.com/s/2ual7dmh4k8i6l4/2023-05-03_12-03-09_Blender_blender.mp4?dl=0

    bruno_perdigao
  • Just as a side note, maybe you already know this, in the meantime I use Numpad . in the outliner to find aggregates.

    Coen
  • @bruno_perdigao said:
    Just as a side note, maybe you already know this, in the meantime I use Numpad . in the outliner to find aggregates.

    Could you elaborate please. I tried pressinng Numpad . In the outliner. but nothing happens. I might be doing something wrong.

  • It is just a way to show in the outliner the object that you selected in the viewport:

    BedsonCoensteverugi
  • I see, I think in general a more context friendly menu would benefit the BlenderBIM add-on UI a lot and make it way more user friendly.

    For example, when you click this wall:

    This wall contains the following

    • IfcElementAssembly
    • IfcOpening
    • IfcCovering
    • IFC Array Modifier
    • Different IFC profiles/materials.

    Would be nice if would be possible, to click a certain shortkey to give all quick acces to the desired menus.
    Similar when you click . in Blender, this shows up:

    I think some kind of BlenderBIM add-on shortcut menu would be cool:

    Or is there maybe already work being done on this which I'm not aware off?

    Bedsonbruno_perdigaoArvMaartenFrough
  • edited May 2023

    Just found this way of selecting the entire blender collection via one selected object. 80 seconds in...

    steverugi
  • Awsome work on Arrays, thanks!
    Could we imagine that array an IfcWindow also arrays the IfcOpeningElement? :)

    bruno_perdigao
Sign In or Register to comment.