mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
248fb3e3fb
Assigning a different length unit as project default, editing the assigned SI length unit's prefix, or assigning Blender scene units only reassigns the IfcUnitAssignment. The length values already stored in the file keep their numbers, so every stored IfcLengthMeasure changes its physical meaning and the whole model is rescaled by the unit ratio on the next load (a 2 m wall reloads as 2 mm after switching metre to millimetre). The viewport looks unchanged because Blender meshes stay in metres, which makes the corruption completely silent until reload. The unit operators now detect when the effective length scale of the project would change while the file already contains length-bearing data (shape representations or material layers) and open a confirmation dialog stating the rescale factor and pointing to the ConvertLengthUnit patch recipe, which converts all stored values and preserves physical size. Fresh projects without geometry keep the frictionless one-click flow, and script/EXEC calls are unaffected. Fixes #6400 Generated with the assistance of an AI coding tool.