Skip to content
This repository was archived by the owner on Mar 1, 2025. It is now read-only.

Commit a8b4fb4

Browse files
committed
BIM: NativeIFC 2D support - small fixes
1 parent a62ce90 commit a8b4fb4

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/Mod/BIM/nativeifc/ifc_export.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ def get_dimension(annotation):
234234
s = ifcopenshell.util.unit.calculate_unit_scale(annotation.file) * 1000
235235
for rep in annotation.Representation.Representations:
236236
shape = importIFCHelper.get2DShape(rep, s, notext=True)
237+
pl = get_placement(annotation.ObjectPlacement, scale=s)
238+
if pl:
239+
shape[0].Placement = pl
237240
if shape and len(shape) == 1:
238241
if len(shape[0].Vertexes) >= 2:
239242
# two-point polyline (BBIM)

src/Mod/BIM/nativeifc/ifc_objects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def edit_annotation(self, obj, attribute, value=None):
214214
else:
215215
print("DEBUG: unknown dimension curve type:",sub)
216216
elif attribute in ["DisplayLength","DisplayHeight","Depth"]:
217-
l = w = h = 1000
217+
l = w = h = 1000.0
218218
if obj.ViewObject:
219219
if obj.ViewObject.DisplayLength.Value:
220220
l = ifc_export.get_scaled_value(obj.ViewObject.DisplayLength.Value, ifcfile)

src/Mod/BIM/nativeifc/ifc_tools.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,9 @@ def differs(val1, val2):
843843
return False
844844
if not val1 and not val2:
845845
return False
846+
if isinstance(val1, (tuple, list)):
847+
if tuple(val1) == tuple(val2):
848+
return False
846849
if val1 is None and "NOTDEFINED" in str(val2).upper():
847850
return False
848851
if val1 is None and "UNDEFINED" in str(val2).upper():
@@ -882,12 +885,13 @@ def differs(val1, val2):
882885
):
883886
# do not consider default FreeCAD names given to unnamed alements
884887
return False
885-
if differs(getattr(element, attribute, None),value):
888+
if differs(getattr(element, attribute, None), value):
886889
FreeCAD.Console.PrintLog(
887890
"Changing IFC attribute value of "
888891
+ str(attribute)
889892
+ ": "
890893
+ str(value)
894+
+ " (original value:" +str(getattr(element, attribute))+")"
891895
+ "\n"
892896
)
893897
api_run(cmd, ifcfile, product=element, attributes=attribs)

0 commit comments

Comments
 (0)