If you're reading this, we've just migrated servers! If anything looks broken please email dion@thinkmoult.com :)

IFC Export Newbie Question

Hello
When I export the Suzanne monkey head from B3D to Revit via BlenderBIM IFC export she only partially comes across. The B3D primitives that I have test so far work. I tried applying a Solidify modifier but that didn't work. Any tips on IFC export appreciated!

Comments

  • Hey @Bedson ! Suzanne works well on my computer. I tested with Revit 2019. I would not recommend adding a solidify modifier as that may create some intersecting geometry that Revit may not like. I have exported her as an IfcBuildingElementProxy object. Do you have a sample blend file you can share? Feel free to send to dion@thinkmoult.com

  • Hi @Moult
    Here's a link to the blend file: https://drive.google.com/file/d/1vGq1fqUHhtuGkozOXh_-YgpVnfK2_Zbq/view?usp=sharing
    I'm using Revit 2021. I have changed Suzanne to an IfcBuildingElementProxy object but she still doesn't import correctly into Revit...I use mm in Revit...

  • edited June 2020

    @Bedson try Revit -> File -> Open (hover for more options) -> IFC instead of Linking the IFC. It seems as though it breaks when linking but works when opening. This looks like a bug in Revit. You can report bugs for Revit here.

    This is what I get when I export and open in Revit:

    This is what I get when I export and link in Revit:

  • @Moult Brilliant! Thank you so much. Onwards with further testing....

    Jesusbill
  • @Moult Although one thing I have noticed is that when the IFC was linked the IFC information came through - like ifcMaterial etc. That information seems to be missing in Revit when opening the IFC file instead of linking...! Linked screenshot of information attached..I was hoping to use some Dynamo to apply a corresponding Revit material using the IFC material name...

  • edited June 2020

    @Bedson you seem to have come across the issue that Revit IFC material support is, well, kinda broken. The manner in which it is broken is numerous and varied, which I won't re-elaborate in this thread. I've tried to investigate this more in the past and the conclusion I arrived to was that Autodesk needs to fix their product. I've reported many material related bugs in the buildingSMART forums, in the Revit Github repo, as well as directly to Autodesk support.

    Unfortunately, and you will discover more and more, the quality of IFC support in Revit is very poor. There is not much I can do about it, and Autodesk as a company (some individuals are the exception) don't seem to want to listen or care enough to fix. These are harsh and condemning statements, but true.

  • Hi @Moult
    In Revit I can see the IFCGuid values but not the IFCMaterials. If there is only one material attached to each object is it possible to get a list of IFCGuid values and their corresponding material Names (maybe through a Blender script?)? I have attached links to a blend file and an IFC file that has IFCGuids and a material on each object..
    https://drive.google.com/file/d/17YKJmOvc3gQoJvjkWATKCHk8ngfyWY0N/view?usp=sharing, https://drive.google.com/file/d/1vGq1fqUHhtuGkozOXh_-YgpVnfK2_Zbq/view?usp=sharing

  • @Jesusbill I have tried to come up with a Revit solution for this problem. Using Dynamo I am aiming to get a location and IFCMaterial value for each element on the Linked IFC. Then I was going to cross-reference this with the location of the same elements in the 'Opened' IFC in Revit so that I could apply the IFCMaterial values. My problem is that the element locations work in the opened IFC file in Revit but not in the 'Linked' IFC file in Revit.

  • @Bedson - sure thing, it is quite easy to do in IfcOpenShell with a few lines of code:

    import ifcopenshell
    f = ifcopenshell.open('New_Test_From_B3D_17.ifc')
    guids = ['3DY1onMen8w9TPwKVoKsIA', '10iXd65697Wg1uFQ8pHayO']
    for element in [f.by_guid(guid) for guid in guids]:
        print(element)
        for material in [a.RelatingMaterial for a in element.HasAssociations if a.is_a('IfcRelAssociatesMaterial')]:
            print(material)
    

    The output for your file is:

    #2257=IfcPipeFitting('3DY1onMen8w9TPwKVoKsIA',#20,'Cylinder',$,$,#2248,#2256,$,.BEND.)
    #2213=IfcMaterial('0BV_Cylinder',$,$)
    #2271=IfcBuildingElementProxy('10iXd65697Wg1uFQ8pHayO',#20,'Suzanne',$,$,#2262,#2270,$,.COMPLEX.)
    #2221=IfcMaterial('0BV_Monkey',$,$)
    
    Bedson
  • edited June 2020

    Hi @Moult Thank you for the Python script. I have found another Python script that exports the IFCGuid and IFCMaterial to an excel file:
    I am an absolute newbie to IFC and Python so I found it too time-consuming to get the correct python programs onto my computer (I tried installing OCC and OpenShell etc - someone on-line made me chuckle by calling it Opens Hell!). I think it might be easier to do this in Blender itself. I have had a quick attempt and it seems to work:
    import bpy
    for o in bpy.context.scene.objects:
    if o.type=='MESH':
    material = o.active_material.name
    global_id_index = o.BIMObjectProperties.attributes.find('GlobalId')
    guid = o.BIMObjectProperties.attributes[global_id_index].string_value
    print(material)
    print(guid)

  • @Bedson if you download the BlenderBIM Add-on, in Blender's console, you can do import ifcopenshell. It comes with all the fun libraries, like ifcopenshell, bcfplugin, fcl, OCC, and more, all the IFC/BIM/BCF/Mesh querying magic you need at your fingertips :) No need to do any fancy installing and getting the correct Python programs, it all comes out of the box.

    If you really do want to do it through Blender, you can do o.BIMObjectProperties.attributes.get('GlobalId').string_value

  • Thanks @Moult, I will try the 'import ifcopenshell' inside Blender at some point.
    The Blender script worked well. I was also able to use a Dynamo graph in Revit to get the materials from a CSV that was generated from Blender. I fell at the last hurdle of applying the materials in Revit - as far as I could tell Revit doesn't allow you to change a Family material inside a project file. In the end I chose to write the material value to a Revit Project Parameter (ifcMaterial). This way I can manually add a material in Revit if I wish - but at least I'll know what the material name was in Blender.
    Here's my script for anyone who's interested:
    import bpy
    import csv
    import os

    outputFile = 'C:/Temp/0_IFCGuid_IFCMaterial.csv'
    f = open(outputFile,'w')

    for o in bpy.context.scene.objects:
    if o.type=='MESH':
    material = o.active_material.name
    global_id_index = o.BIMObjectProperties.attributes.find('GlobalId')
    guid = o.BIMObjectProperties.attributes[global_id_index].string_value
    print(guid)
    print(material)
    f.writelines(guid)
    f.writelines('\n')
    f.writelines(material)
    f.writelines('\n')
    f.close()
    And a link to my Graph from Revit :https://drive.google.com/file/d/1gzg1tye5zLAvqgG7RCE_25pJ9kPSGFIP/view?usp=sharing

    Moult
Sign In or Register to comment.