Skip to content

AttributeError: module 'ifcopenshell.util' has no attribute 'pset' #1462

@brunopostle

Description

@brunopostle

I'm probably doing something wrong here, trying to add a pset to an object using the python api:

    entity = ifcopenshell.api.run(
        "root.create_entity",
        ifc,
        ifc_class="IfcSpace",
        name="My Space",
    )
    pset = ifcopenshell.api.run(
        "pset.add_pset", 
        ifc, 
        product=entity, 
        Name="Pset_SpaceCommon"
    )
    ifcopenshell.api.run(
        "pset.edit_pset", 
        ifc, 
        pset=pset, 
        properties={"IsExternal": True}
    )

This is the error:

  File "/usr/lib64/python3.9/site-packages/ifcopenshell/api/__init__.py", line 10, in run
    return usecase_class(ifc_file, **settings).execute()
  File "/usr/lib64/python3.9/site-packages/ifcopenshell/api/pset/edit_pset.py", line 13, in execute
    self.load_pset_template()
  File "/usr/lib64/python3.9/site-packages/ifcopenshell/api/pset/edit_pset.py", line 24, in load_pset_template
    self.psetqto = ifcopenshell.util.pset.get_template("IFC4")
AttributeError: module 'ifcopenshell.util' has no attribute 'pset'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions