[IFC] Deleting elements

edited July 2022 in General

Hi! I'm having issues deleting objects in my test.ifc file in blender.
I have looked around in the OSArch Community and tried unlink class from object , then delete from blender, exported IFC. When I reimport the deleted object is still there...

«13

Comments

  • Is it possible for you to share your IFC file and say in detail what you would like to delete? Which IfcClass for example :-)

  • Sure! I testing the merge functionality in blenderbim an got some extra artifacts I tried to remove.

  • Were you trying to delete IfcFurnishingElement/Cube.002? And then export it again?

  • Yes, I want to know how I can delete elements in a IFC file. Often we get large IFC files because some architects export bushes and trees with leaves on them(!?). All this geometry makes the IFC very slow and large. So it would be great to able to delete objects. The file I sent you is just for testing out how to merge files and how to delete objects. Just to get a feel for how the software handles IFC

  • Yes, I want to know how I can delete elements in a IFC file.

    I don't think you can delete just anything in IFC as you would like?, IFC has a certain hierarchy.

  • I think just delete should work for objects in IfcElement class.
    I'm not really sure, but I suspect it has to do with the tree organization. The emptys representing IfcSpacialStrutuctureElement should be inside their respective collection. For example, both IfcSite are inside the collection "IfcSite/My Site.002".
    Also, I noticed that "TEST B" file has an empty with "IfcFurnishingElement" assigned to it, and has the same GlobalID as the cube in the "TEST A" file. That might be causing conflict.

  • edited April 2022

    OK. Thank you so much Coen and bruno_perdigao
    Same global ID is probably not a good thing :D (I know, the IFC file is a mess, -just a simple test) The reason is that I wanted to try the MergeProject recipe.
    But, my issue with deleting IFC elements has haunted me for a while now, and I cant find a clear answer.
    My latest attempt to delete an element is with this procedure (https://community.osarch.org/discussion/645/):

    • select element (e.g IfcDoor/D01)
    • hit the unlink class button, and then hit delete button, save IFC,
    • Load saved IFC to new scene
    • The element still exist. I have tried with multiple IFC files both existing and IFCs created in BlenderBim (with different GlobalIDs :D) and I get the same result every time.
  • For me it usually works, but I don't do the "unlink" step, I just delete the object.
    So I made a small test here, and if I unlink and then delete, I can reproduce your problem, the element still exists.
    Did you try deleting without unlinking?

  • I checked the console, and it seems that when you unlink the object is not really deleted.

  • Hmm...weird stuff. In the other discussion this method seemed to work, but that was probably related to an earlier build and another version.
    BUT! I got it working after a few attempts! :D
    Created a simple IFC2X3 Project in blender and added a cube as a IfcFurnishingElement, and saved the IFC.
    New scene-import saved IFC - Deleted the element with delete key -saved the IFC - new scene, import ifs - Cube exists - no success
    Same thing, but used the X key - no success
    Then I remembered something from a while back about holding **down the shift-key while pressing the X-key **to delete objects globally in blender.
    Tried it and...SUCCESS!!! The IFC element is gone!
    Now is a time for celebration! This will make cleaning up messy IFC`s a dream both before and after merging projects :)
    And with the export CSV functionality combined with the BlenderBim Spreadsheet add-on....My God....

    Thank you so much for your insight and support. The OSArch community is really amazing!

    Nigelbruno_perdigao
  • PS!
    I used a Mac while testing the different methods for deleting. On a Mac - Shift-x method was the only one that worked. (macOS Monterey - Blender 3.01 - BlenderBim devbuild220330)
    In windows I tried delete-key(no success), but weirdly both x-key and shift-x-key works.(Win10-64 - Blender 3.01 - BlenderBim devbuild220330)

    Nigelbruno_perdigao
  • Weird, indeed. Maybe it's worth reporting an issue on GitHub.

  • edited April 2022

    bruno_perdigao Hi! If you got time, can you show me the code for deleting elements (one or all selected) in terminal/python? Looked around in forums/wiki but I may be blind...

  • In the example above I didn't delete through the terminal, I deleted them with 'delete' key in Blender, and just used the console to check whether the Ifc Elements were still saved in the ifc file. I tried to use the .remove as described here but it just crashed Blender.

  • edited April 2022

    NO chance to get rid off one ifcbeam in the model.. shift-X or whatever, unlink or move to another collection. ifc model is 2x3.
    Blender 3.1.2 + BB 220321, now on BB 220425.. and shift+X was right?? done..
    but something turns out to go wrong.. when importing to Dialux, the original file goes well, not the modified one. need to check if the 2x3-scheme is respected..Dialux is still on 2x3 :-(.. time to switch to LiVi (VI-Suite)

  • @haukj thanks for your report. I checked your file and your merged file contains two objects with the same GlobalId. This is not allowed, so there are two cubes in the same spot with the same GlobalId. This means that when you import, firstly odd things may happen since it isn't unique, but what happens is that only one of the two cubes gets imported. Then, when you delete it and save, it is deleted, but the other cube with the same GlobalId still exists, so it will appear to you as though the delete didn't work, although it did.

    To delete, it should be as simple as clicking the object you want deleted, and pressing X or the Delete key. Then you will need to save your project (Scene Properties > Project Panel > Save Project).

    @lukas what issue are you facing? Can you share a file and exactly what steps you are doing so I can help recreate it?

  • @lukas I checked your file and the operations you're doing seems to work for me:

    1. Load in BlenderBIM Add-on
    2. Move or delete beam
    3. Save (or save as)
    4. New session, load modified IFC, and confirm beam has moved / deleted

    From your screenshots indeed Dialux seems to have a very poor IFC import. But it seems as though this is unrelated to modifying it in Blender, perhaps the experience in Dialux is already poor with the original IFC?

  • Thank You @moult. Yes, Dialux needs some updates.. I recommended OpenIfcShell many times. I will send them the file too. But probably one will not learn what went wrong. Free but not open, there.

  • @moult Maybe this is an issue on MAC´s with M1 processors running blender x86 version ((Rosetta Emulator). Have tried to delete IFC objects from different IFC`s . No problem with windows version. On my new macpro with M1 it wont delete the object in the IFC file.

  • @haukj oh wow, running on M1 with an emulator for x86? I don't see how that would affect things but I have no idea. Are you available for a screenshare to debug what you are experiencing? I don't have a Mac so I can't recreate your issue here.

  • @moult - Yes :) At work right now, so I will do it later

  • @haukj drop by the OSArch.org/chat - I'm usually available sometime during the Sydney timezone :)

  • edited May 2022

    I did find changes in some declarations between the original archicad file and the BlenderBim modified ifc.
    original:#558= IFCCLASSIFICATIONREFERENCE('IFC Export Typ-Zuodnung:\X\0DIFC2x3: IfcWall | USERDEFINED | NOTDEFINED\X\0DIFC4: IfcWall | NOTDEFINED','Wand',$,#331);
    BB:#558=IFCCLASSIFICATIONREFERENCE('IFC Export Typ-Zuodnung:\X2\000D\X0\IFC2x3: IfcWall | USERDEFINED | NOTDEFINED\X2\000D\X0\IFC4: IfcWall | NOTDEFINED','Wand',$,#331);
    Is this X or X2 path-value what Dialux can not handle?
    and in the original:
    #850289= IFCDIRECTION((1.,0.,0.));
    #850291= IFCDIRECTION((0.,0.,1.));
    #850293= IFCCARTESIANPOINT((0.,0.,0.));
    #850295= IFCAXIS2PLACEMENT3D(#850293,#850291,#850289);
    #850296= IFCLOCALPLACEMENT(#850272,#850295);
    which are missing completely in the BB version ? (this omission is quite often). But can be found at the end of the BB file (kind of differently linked to the object).
    So the tree structure is modified by BlenderBIM.. probably in 'legal' way since Solibri does accept it... only the poor Dialux import does not.
    any recommendation to forward to them?

  • The \X\0D etc are how STEP handles encoding of special characters. I don't know enough about the encoding to know whether or not IfcOpenShell's modifications are legitimate. It seems to have been automatic, as you never explicitly edited a classification reference. Perhaps @aothms knows why the change was made?

    Asfor the changed directions, cartesian points, and placements, that's because you moved a beam. When you moved it, the BlenderBIM Add-on selectively deleted old location (that's why it's missing) and added a new location (that's why you found a new version of it at the end).

  • Indeed \X\0D will be rewritten by IfcOpenShell to \X2\000D\X0\ but they are equivalent encodings

  • I've been reading this thread, and I have the same problem as the OP.

    Can't manage to delete an IfcBeam instance from this file.

    Tried unlinking, deleting and exporting under a different name.. this horizontal beam keeps appearing.

  • Deleting seems to work for me. I'm on Windows.
    video: https://www.dropbox.com/s/ygh97enlrn0nbds/2022-07-07_10-26-59_Blender_blender.mp4?dl=0
    Are you on Mac?
    Maybe same problem @ChubbyQuark had here?

  • Picking up this Convo again, also have the same issue, I tried with all these test files people had problems with and have the same issue with every IFC,

    running windows 10, latest Blenderbim and Blender 3.2.2 through Steam, it's definitely something to do with the system or setup and not the IFC files here.

    Tried the process on another PC and delete works no problem on all the files

    Anyone got any ideas?

  • Here also the same issue. Moving elements seems to work but deleted elements keep reappearing when importing the IFC.

  • For some odd reason when I rename the IFC file and move it to another folder, I can delete IFC elements. Will try to reproduce it somehow.

    Acepstrokap
Sign In or Register to comment.