Menu

Export IFC GUID as mesh name (instead of IfcName + EntityLabel)

abood noah
2022-03-25
2022-03-26
  • abood noah

    abood noah - 2022-03-25

    Hi everone
    is it possible to overwrite the Name of geometry in IFC with its GUID, for example instead of :
    Name:STB Stütze - rechteckig:I_ST_STB_OB_600x600:1751780
    it will be:
    Name:3Ff3v2cZD4keisde$zHEIo
    thanks in advance

     
  • Thomas Krijnen

    Thomas Krijnen - 2022-03-25

    Not sure what precisely you are after, are you looking to update an existing IFC file, modify an application or configure the output of IfcConvert for example.

    For IfcConvert there is the options --use-element-name or --use-element-guid

    If you'd like to postprocess an IFC file, you could do sth like this in python:

    import sys
    import ifcopenshell
    
    ifn, ofn = sys.argv[1:]
    
    f = ifcopenshell.open(ifn)
    
    for elem in f.by_type("IfcObjectDefinition"):
      elem.Name = elem.GlobalId
    
    f.write(ofn)
    

    But the reverse is not possible, because the string data type in Name is more permissive.

     
  • abood noah

    abood noah - 2022-03-26

    Hi Thomas,
    Thx for your response,
    can i make this in Blender scripting enviroment or should i download ifopenshell in other enviroment?
    thx in advance

     
    • Thomas Krijnen

      Thomas Krijnen - 2022-03-26

      sure just find another way to input the input and output filename in the script

       
  • abood noah

    abood noah - 2022-03-26

    Thx Thomas,
    thanks for your help, it did work
    love IfcOpenShell <3

     
  • abood noah

    abood noah - 2022-03-26

    Thx Thomas,
    thanks for your help, it did work
    love IfcOpenShell <3

     
    🎉
    2

Log in to post a comment.