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
+1 -1
View File
@@ -51,7 +51,7 @@ class CsvHeader(TypedDict):
# Assigning rates
RateSchedule: NotRequired[str]
RateID : NotRequired[str]
RateID: NotRequired[str]
# Currently we assume that if column is not part of the main header,
@@ -107,7 +107,7 @@ def _add_segment_to_layout(file: ifcopenshell.file, layout: entity_instance, seg
y = float(end[1, 3]) / unit_scale
dx = float(end[0, 0])
dy = float(end[1, 0])
zero_length_segment.DesignParameters.StartPoint.Coordinates = (x,y)
zero_length_segment.DesignParameters.StartPoint.Coordinates = (x, y)
zero_length_segment.DesignParameters.StartDirection = dy / dx
elif zero_length_segment.DesignParameters.is_a("IfcAlignmentVerticalSegment"):
y = float(end[1, 3]) / unit_scale
@@ -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