# OffsetProfileParametersStation script anomaly

**URL:** <https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554>\
**Category:** Civil 3D\
**Tags:** python, dynamo\
**Created:** [July 27, 2021, 2:12pm UTC](https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554 "2021-07-27T14:12:48Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kovacsv](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@kovacsv](https://forum.dynamobim.com/u/kovacsv)\
**Post date:** [July 27, 2021, 2:12pm UTC](https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554/1 "2021-07-27T14:12:48Z")

</div>

Hey Guys,

I created a script to add superelevation data as offset profile cross slope values, but it is acting strangely:

1. Works perfectly on the outer offset alignment (that is longer than the centerline) if start station is 0+000
2. Gives “parameter station outside profile range” error on the inner offset alignment (that is shorter than the centerline) regardless of start station. Does not find end station.
3. If the start station is not 0+000, after a successful run (all python script variables give correct values) the station values are the double the correct values in the offset profile properties window.

So I have two major issues:

- If the offset alignment is shorter, than the parent, for some reason it doesn’t recognise parent’s last station. Tried this manually as well, but it doesn’t accept last point either, but this one doesn’t make sense to me.
- If start station of the parent is not 0+000 the srcipt works as intended, but the actual cross slope station values are doubled. If I substract start station of the values I get “parameter station outside profile range” of course.

I don’t know if there is something with my beginner pyton script, or is it an API issue, and I should rather post it to the Autodesk forum.  
Has anyone met this issue? I attached a sample dwg containing all cases, and the dyn as well.  
Thanks.  
[Offset superelevation.dwg](https://forum.dynamobim.com/uploads/short-url/wJQOPClHEQYEzWkSrAhhEumGh8h.dwg) (1.3 MB)  
[Offset superelevation.dyn](https://forum.dynamobim.com/uploads/short-url/ddKrqXVATBGe9LSX5f2lbQZFjg9.dyn) (160.0 KB)

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [July 27, 2021, 3:15pm UTC](https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554/2 "2021-07-27T15:15:23Z")

</div>

Hi @kovacsv,

I tested it out and it seems to be working as intended when all of the correct inputs are selected. My guess is that you’re getting errors when you accidentally select the wrong alignments, such as selecting a parent alignment and then selecting an offset alignment from a different parent alignment. It might make the script more robust if you get the offset alignments and profiles (for example using the GetChildOffsetAlignmentsIds() method in the Alignment class) instead of asking the user to select them manually.

Also, it seems like the “RightOutLane” cross segment type is not returning the correct slopes when using _AlignmentSuperElevationData.GetSlope_. Can you confirm?

---

<div class="post-metadata">

**Author:** ![kovacsv](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@kovacsv](https://forum.dynamobim.com/u/kovacsv)\
**Post date:** [July 27, 2021, 3:47pm UTC](https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554/3 "2021-07-27T15:47:02Z")

</div>

Thanks @zachri.jensen I check again and try with GetChildOffsetAlignmentsIds().  
I froze RightOutLane because it is not working properly, but I already adressed that in the toolkit feedback thread and if I am not mistaken github shows that it is already taken care of.

---

<div class="post-metadata">

**Author:** ![kovacsv](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@kovacsv](https://forum.dynamobim.com/u/kovacsv)\
**Post date:** [July 28, 2021, 7:56am UTC](https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554/4 "2021-07-28T07:56:05Z")

</div>

So, I tested all cases again and same results as described earlier ☹  
Used AlignmentExtensions.GetOffsetAlignments node to make sure they are the right ones, and the results differ on the right (shorter) and the left (longer) side. If I delete last station on the shorter side it works fine.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/8/486b9a0aae0ad582dbb8a59336b479ec4b905f19.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/6/86a9cd376ca2343a55cf24e846c8bf31d13117f0.png)

Also when stationing doesn’t start at 0+000 the station values are doubled though the script output Profile.OffsetProfileParametersStation.Station values are correct ☹

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/6/364d9b9f3c035f093ddee7d6623a9bf1c7c003e3.png)

---

<div class="post-metadata">

**Author:** ![kovacsv](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@kovacsv](https://forum.dynamobim.com/u/kovacsv)\
**Post date:** [August 4, 2021, 7:50am UTC](https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554/5 "2021-08-04T07:50:44Z")

</div>

So, any ideas, anyone? ☹

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [August 4, 2021, 9:36am UTC](https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554/6 "2021-08-04T09:36:04Z")

</div>

Hi @kovacsv  
Please attached dynamo file  
Try this

---

<div class="post-metadata">

**Author:** ![kovacsv](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@kovacsv](https://forum.dynamobim.com/u/kovacsv)\
**Post date:** [August 4, 2021, 10:05am UTC](https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554/7 "2021-08-04T10:05:28Z")

</div>

[Offset superelevation.dwg](https://forum.dynamobim.com/uploads/short-url/lwOyLJq9VVLfsN2lHYq3F8cy0ZZ.dwg) (1.3 MB)  
[Offset superelevation.dyn](https://forum.dynamobim.com/uploads/short-url/oXJNBg85KBVjFyLYiP5DyGQ31ET.dyn) (166.0 KB)

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [August 4, 2021, 11:37am UTC](https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554/8 "2021-08-04T11:37:52Z")

</div>

Hi @kovacsv  
It works fine  
Can you guide me to the problem?  
Because my language is not good, I do not understand well

 ![p2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/b/ab021f06097ef8a7acf48492a338c65e6b49deb0.jpeg)  
 ![p1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/f/2f52b21ddd82ff0f950f907f3a71991ccb839b8b.jpeg)

[Offset superelevation rr .dyn](https://forum.dynamobim.com/uploads/short-url/o5chs4s91J2EjyQwV3HAaWz2Y5G.dyn) (89.9 KB)  
[Offset superelevation 0t22.dwg](https://forum.dynamobim.com/uploads/short-url/zRWkGAlWsrIZlkzlmQqMO0hpaI4.dwg) (1.2 MB)

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [August 4, 2021, 11:51am UTC](https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554/9 "2021-08-04T11:51:31Z")

</div>

for superelevation data as “RightOutLane” values or any type  
using this

 ![get](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/f/2f90f8d4fc0f181c428d656c90e443ab65513161.jpeg)  
[GetSlopetest .dyn](https://forum.dynamobim.com/uploads/short-url/xZ3PCv89UzJ06RReaRuYXOfzM4K.dyn) (23.0 KB)

---

<div class="post-metadata">

**Author:** ![kovacsv](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@kovacsv](https://forum.dynamobim.com/u/kovacsv)\
**Post date:** [August 4, 2021, 12:03pm UTC](https://forum.dynamobim.com/t/offsetprofileparametersstation-script-anomaly/66554/10 "2021-08-04T12:03:07Z")

</div>

Well, in your file it works perfectly in every case described above, so I must have messed up something in the test file, I have no idea what caused the problem. Thank you for your time, and the getslope dyn, I’ll definitely try it out.
