This commit is contained in:
Andrej730
2025-09-10 13:12:56 +05:00
parent 1e9239b352
commit 10e805b3f1
3 changed files with 8 additions and 8 deletions
@@ -23,20 +23,20 @@ class Patcher(ifcpatch.BasePatcher):
def patch(self):
patched_file = ifcopenshell.file.from_string(self.file.wrapped_data.to_string())
alignments = patched_file.by_type("IfcAlignment")
for alignment in alignments:
basis_curve = ifcopenshell.api.alignment.get_basis_curve(alignment)
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 = 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
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 = ifcopenshell.util.element.get_pset(referent, "Pset_Stationing", "Station")
# station = referent.IsDefinedBy[0].RelatingPropertyDefinition.HasProperties[0].NominalValue.wrapped_data # get station from current referent
object_placement = patched_file.createIfcLinearPlacement(
RelativePlacement=patched_file.createIfcAxis2PlacementLinear(
Location=patched_file.createIfcPointByDistanceExpression(
@@ -47,7 +47,7 @@ class Patcher(ifcpatch.BasePatcher):
BasisCurve=basis_curve,
)
),
)
)
referent.ObjectPlacement = object_placement