MEASUREMENT should also be checked if INSUNITS is zero

This commit is contained in:
Roy-043
2023-11-09 11:12:02 +01:00
committed by Yorik van Havre
parent ab3bb51e15
commit 704949d843

View File

@@ -2084,13 +2084,12 @@ def getScaleFromDXF(header):
header : header object
"""
data = header.data
insunits = 0
if [9, "$INSUNITS"] in data:
insunits = data[data.index([9, "$INSUNITS"]) + 1][1]
elif [9, "$MEASUREMENT"] in data:
if insunits == 0 and [9, "$MEASUREMENT"] in data:
measurement = data[data.index([9, "$MEASUREMENT"]) + 1][1]
insunits = 1 if measurement == 0 else 4
else:
insunits = 0
if insunits == 0:
# Unspecified