Remove usage of .wrapped_item and some other fixes

This commit is contained in:
Thomas Krijnen
2026-01-10 11:01:18 +01:00
parent 5c9213426f
commit b66b04b001
55 changed files with 129 additions and 118 deletions
+1 -1
View File
@@ -204,7 +204,7 @@ class Patcher(ifcpatch.BasePatcher):
d.name() for d in self.schema.declarations() if isinstance(d, ifcopenshell.ifcopenshell_wrapper.entity)
]
else:
ifc_classes = self.file.wrapped_data.types()
ifc_classes = self.file.types()
for ifc_class in ifc_classes:
declaration = self.schema.declaration_by_name(ifc_class)
@@ -22,7 +22,7 @@ class Patcher(ifcpatch.BasePatcher):
self.file_patched: ifcopenshell.file
def patch(self):
patched_file = ifcopenshell.file.from_string(self.file.wrapped_data.to_string())
patched_file = ifcopenshell.file.from_string(self.file.to_string())
alignments = patched_file.by_type("IfcAlignment")
for alignment in alignments:
@@ -31,12 +31,12 @@ class Patcher(ifcpatch.BasePatcher):
nests = alignment.IsNestedBy
first_referent = nests[1].RelatedObjects[0]
start_station = ifcopenshell.util.element.get_pset(first_referent, "Pset_Stationing", "Station")
# start_station = first_referent.IsDefinedBy[0].RelatingPropertyDefinition.HasProperties[0].NominalValue.wrapped_data # get station from first_referent
# start_station = first_referent.IsDefinedBy[0].RelatingPropertyDefinition.HasProperties[0].NominalValue # get station from first_referent
for referent in nests[1].RelatedObjects:
if referent.ObjectPlacement == None:
# Need to get Station property from Pset_Stationing + Station property from the first referent... the DistanceAlong is the different in these values
station = ifcopenshell.util.element.get_pset(referent, "Pset_Stationing", "Station")
# station = referent.IsDefinedBy[0].RelatingPropertyDefinition.HasProperties[0].NominalValue.wrapped_data # get station from current referent
# station = referent.IsDefinedBy[0].RelatingPropertyDefinition.HasProperties[0].NominalValue # get station from current referent
object_placement = patched_file.createIfcLinearPlacement(
RelativePlacement=patched_file.createIfcAxis2PlacementLinear(
Location=patched_file.createIfcPointByDistanceExpression(
@@ -65,7 +65,7 @@ class Patcher:
deleted.sort()
deleted_q = deque(deleted)
new = ""
for line in self.file.wrapped_data.to_string().split("\n"):
for line in self.file.to_string().split("\n"):
try:
if int(line.split("=")[0][1:]) != deleted_q[0]:
new += line + "\n"