@settings(defaultLengthUnit = mm)

sketch001 = startSketchOn(XZ)
profile001 = circle(sketch001, center = [154.36, 113.92], radius = 41.09)
extrude001 = extrude(profile001, length = 200)
sketch002 = startSketchOn(XY)
profile002 = startProfile(sketch002, at = [72.24, -52.05])
  |> angledLine(angle = 0, length = 181.26, tag = $rectangleSegmentA001)
  |> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 21.54)
  |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $mySeg)
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()
extrude002 = extrude(profile002, length = 150)
  |> chamfer(
       %,
       length = 15,
       tags = [mySeg],
       tag = $seg02,
     )

sketch003 = startSketchOn(extrude002, face = mySeg)
profile003 = startProfile(sketch003, at = [207.36, 126.19])
  |> angledLine(angle = 0, length = 33.57, tag = $rectangleSegmentA002)
  |> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 99.11)
  |> angledLine(angle = segAng(rectangleSegmentA002), length = -segLen(rectangleSegmentA002), tag = $seg01)
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()
extrude003 = extrude(profile003, length = -20)
sketch004 = startSketchOn(extrude003, face = seg01)
profile004 = startProfile(sketch004, at = [-235.38, 66.16])
  |> angledLine(angle = 0, length = 24.21, tag = $rectangleSegmentA003)
  |> angledLine(angle = segAng(rectangleSegmentA003) - 90, length = 3.72)
  |> angledLine(angle = segAng(rectangleSegmentA003), length = -segLen(rectangleSegmentA003))
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()
extrude004 = extrude(profile004, length = 30)

sketch005 = startSketchOn(extrude002, face = seg02)
profile005 = startProfile(sketch005, at = [-129.93, -59.19])
  |> xLine(length = 48.79)
  |> line(end = [1.33, 11.03])
  |> xLine(length = -60.56, tag = $seg03)
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()
extrude005 = extrude(profile005, length = -10)
sketch006 = startSketchOn(extrude005, face = seg03)
profile006 = startProfile(sketch006, at = [-95.86, 38.73])
  |> angledLine(angle = 0, length = 3.48, tag = $rectangleSegmentA004)
  |> angledLine(angle = segAng(rectangleSegmentA004) - 90, length = 3.36)
  |> angledLine(angle = segAng(rectangleSegmentA004), length = -segLen(rectangleSegmentA004))
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()
extrude006 = extrude(profile006, length = 13)