diff --git a/src/ifcopenshell-python/ifcopenshell/api/profile/add_arbitrary_profile.py b/src/ifcopenshell-python/ifcopenshell/api/profile/add_arbitrary_profile.py index bcd413cdbf..edf1d22408 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/profile/add_arbitrary_profile.py +++ b/src/ifcopenshell-python/ifcopenshell/api/profile/add_arbitrary_profile.py @@ -58,7 +58,12 @@ class Usecase: if self.file.schema == "IFC2X3": curve = self.file.createIfcPolyline([self.file.createIfcCartesianPoint(p) for p in points]) else: - curve = self.file.createIfcIndexedPolyCurve(self.file.createIfcCartesianPointList3D(points)) + dimensions = len(points[0]) + if dimensions == 2: + ifc_points = self.file.createIfcCartesianPointList2D(points) + elif dimensions == 3: + ifc_points = self.file.createIfcCartesianPointList3D(points) + curve = self.file.createIfcIndexedPolyCurve(ifc_points) return self.file.createIfcArbitraryClosedProfileDef("AREA", self.settings["name"], curve) def convert_si_to_unit(self, co): diff --git a/src/ifcopenshell-python/ifcopenshell/api/profile/add_arbitrary_profile_with_voids.py b/src/ifcopenshell-python/ifcopenshell/api/profile/add_arbitrary_profile_with_voids.py index 0e784ad207..a33b4d38be 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/profile/add_arbitrary_profile_with_voids.py +++ b/src/ifcopenshell-python/ifcopenshell/api/profile/add_arbitrary_profile_with_voids.py @@ -74,7 +74,12 @@ class Usecase: outer_curve = self.file.createIfcIndexedPolyCurve(self.file.createIfcCartesianPointList3D(outer_points)) inner_curves = [] for inner_point in inner_points: - inner_curves.append(self.file.createIfcIndexedPolyCurve(self.file.createIfcCartesianPointList3D(inner_point))) + dimensions = len(inner_point[0]) + if dimensions == 2: + ifc_points = self.file.createIfcCartesianPointList2D(inner_point) + elif dimensions == 3: + ifc_points = self.file.createIfcCartesianPointList3D(inner_point) + inner_curves.append(self.file.createIfcIndexedPolyCurve(ifc_points)) return self.file.createIfcArbitraryProfileDefWithVoids("AREA", self.settings["name"], outer_curve, inner_curves) def convert_si_to_unit(self, co):