Skip to content

IfcPatch ConvertLengthUnit recipe doesn't convert IfcCurveSegment.SegmentStart and SegmentLength #5656

@RickBrice

Description

@RickBrice

I am trying to use IfcPatch ConvertLengthUnit recipe to convert the files in https://github.com/bSI-RailwayRoom/IFC-Rail-Unit-Test-Reference-Code/tree/master/alignment_testset/IFC-WithGeneratedGeometry to FOOT units.

Everything works great except for the SegmentStart and SegmentLength attributes of IfcCurveSegment.

This seems like a good "beginner" problem to solve, so I'm looking for some guidance on how to approach the problem and develop a solution.

It looks like the work is done in ifcopenshell.util.unit.convert_file_length_units which calls

# Traverse all elements and their nested attributes in the file and convert them
for element, attr, val in iter_element_and_attributes_per_type(file_patched, "IfcLengthMeasure"):
if isinstance(val, ifcopenshell.entity_instance):
new_value = convert_value(val.wrappedValue)
getattr(element, attr.name()).wrappedValue = new_value
else:
new_value = convert_value(val)
setattr(element, attr.name(), new_value)

For one of the files I'm trying to convert the SegmentLength attribute is IFCLENGTHMEASURE(100.0):

#36 = IFCCURVESEGMENT(.CONTINUOUS., #42, IFCLENGTHMEASURE(0.), IFCLENGTHMEASURE(100.), #45);

It seems like the IFCLENGTHMEASURE should be converted, but it doesn't. Perhaps it has to do with mixed case versus all upper case text.

I would like guidance on how to solve this myself. I am willing to get onto OSArch for a screen share if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions