Removing IFC data

Hi. Just wondering if it was possible to remove p_sets or other metadata using ifcopenshell and/or blenderBIM

Tagged:

Comments

  • You mean an ifcpatch to remove a list of psets ?
    Else in Blender + BIM addon of course you can remove any attribute/property/pset.

  • Hi everyone. I'm coming back to this item. The link above broke, but I'm assuming the updated one is: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/ifcopenshell-python/ifcopenshell/api/pset/remove_pset.py
    I've been able to get to the python console, but wondering if you could provide an example. My use case would be to remove all p_sets from an ifc, i.e. retain all geometry and type name, but no more.

  • @edwinguerra purging is not the same as "unassign a pset from a product", which is more an authoring usecase that I suggested above. For purging, here's some untested code which should be more efficient.

    import ifcopenshell
    f = ifcopenshell.open('model.ifc')
    for rel in f.by_type('IfcRelDefinesByProperties'):
        ifcopenshell.util.element.remove_deep(f, rel.RelatingPropertyDefinition)
        f.remove(rel)
    

    But may I ask why you are doing this? I have had similar requests in the past, usually because companies are afraid of their "IP" being lost or wanting to cripple BIM data for a recipient that they don't have a good relationship with. If so, I highly recommend you think twice about what you're doing, since the whole point of OSArch is to work together more.

  • Thanks Dion. Yes, it is along the lines of limiting liability when sharing to external parties, like a contractor, when not previously agreed upon or paid for. There are model release forms and all, but still there seems to be interest to prevent any further unintended use. A workflow exists currently which is to export to fbx, but I think IFC would be preferable. I agree, that the best would be to make the whole model and information available, yet there is still the belief that the contractor/subcontractor will get an advantage by using the model in its complete form. And then there are the modeling shortcuts that people take, so things may look good in 2D, but not in the actual model. Would be curious to know your thoughts on this. It would be great if in the future model was released alongside drawings. Preventing the manual take-off of items by all bidding parties alone would improve the karma of the industry.

  • My recommendation, without knowing your full situation, is to simply give them as much data as possible using open digital formats. At this moment, drawings are treated as the legal source of truth so if they misinterpret your model data (e.g. when modeling shortcuts are used), that is on them. Money being spent to recreate withheld data is a wasted opportunity for our built environment, especially when a lot of that money is in the public sector, or could otherwise be used to invest in innovation, sustainability, and other initiatives which, much like "open source / transparency", often get cut first from a project as a low priority item.

    We are already trending towards models being used as legal submissions and I know of a few projects where this is the case. We're already struggling to get rudimentary correct data in our models, let alone with people purposely sabotaging them.

    Coen
  • edited October 9

    @Moult said:
    @edwinguerra purging is not the same as "unassign a pset from a product", which is more an authoring usecase that I suggested above. For purging, here's some untested code which should be more efficient.

    import ifcopenshell
    f = ifcopenshell.open('model.ifc')
    for rel in f.by_type('IfcRelDefinesByProperties'):
        ifcopenshell.util.element.remove_deep(f, rel.RelatingPropertyDefinition)
        f.remove(rel)
    

    But may I ask why you are doing this? I have had similar requests in the past, usually because companies are afraid of their "IP" being lost or wanting to cripple BIM data for a recipient that they don't have a good relationship with. If so, I highly recommend you think twice about what you're doing, since the whole point of OSArch is to work together more.

    unfortunately the code snipped returns the following error:

    Warning:AttributeError : 'file' object has no attribute 'batch' [' File "", line 119, in \n', ' File "C:\Users\xxxxx\AppData\Local\python-3.8.3-embed-amd64\Lib\site-packages\ifcopenshell\util\element.py", line 126, in remove_deep\n ifc_file.batch()\n', ' File "C:\Users\xxxxx\AppData\Local\python-3.8.3-embed-amd64\Lib\site-packages\ifcopenshell\file.py", line 95, in getattr\n return getattr(self.wrapped_data, attr)\n', ' File "C:\Users\xxxxx\AppData\Local\python-3.8.3-embed-amd64\Lib\site-packages\ifcopenshell\ifcopenshell_wrapper.py", line 1419, in \n getattr = lambda self, name: _swig_getattr(self, file, name)\n', ' File "C:\Users\xxxxx\AppData\Local\python-3.8.3-embed-amd64\Lib\site-packages\ifcopenshell\ifcopenshell_wrapper.py", line 80, in _swig_getattr\n raise AttributeError("\'%s\' object has no attribute \'%s\'" % (class_type.name, name))\n']

    @Moult to your question why to do this:
    quite frequently i am receiving ifc data containing corrupt psets - meaning missing properties, ... or containing unagreed psets. in order to clean those files for further work i try to remove those unwanted data.
    peter

Sign In or Register to comment.