# Offset Polylines and modify the offseted polylines elevations!

**URL:** https://forum.dynamobim.com/t/offset-polylines-and-modify-the-offseted-polylines-elevations/81318
**Category:** Civil 3D
**Created:** [September 21, 2022, 6:02pm UTC](https://forum.dynamobim.com/t/offset-polylines-and-modify-the-offseted-polylines-elevations/81318 "2022-09-21T18:02:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![S.Abbosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/s.abbosh/32/146722_2.png) [@S.Abbosh](https://forum.dynamobim.com/u/S.Abbosh)
#### Post date: [September 21, 2022, 6:02pm UTC](https://forum.dynamobim.com/t/offset-polylines-and-modify-the-offseted-polylines-elevations/81318/1 "2022-09-21T18:02:10Z")

</div>

Dear all,  
I hope you are all doing very well. I am trying to set the following using dynamo  
I have a new DWG file with one polyline projected in the DWG as a square shape.

I tried to create a script in dynamo to offset the polyline to 5 polylines in the positive direction and 5 in the negative direction ( left and right). I was able to create this script with the node-number, but I was unable to create the same script with Slider ( I always get many overlapped polylines). Is there a solution to that?

I was also trying to give these offset polylines different elevations by creating another Dynamo script, I tried to use Objectextension.GetParameters node connected to Dictionary.ValueAtKey to collect all the polylines elevations and tried to use List.Chop to have each polylines elevation separately so that I can modify that, but unfortunately, I couldn’t find a suitable solution.

Any suggestion or help is very appreciated, and thankful for your tips and helps.

I wish you a nice day, and thanks for your support  
Kindly regards  
Salwan  
[OffsetPolyLineandAddPolylines ElevationsScript.dyn](https://forum.dynamobim.com/uploads/short-url/gjgmPMSD7JE5GKcSzjJe0oQvF54.dyn) (47.2 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: [September 21, 2022, 6:26pm UTC](https://forum.dynamobim.com/t/offset-polylines-and-modify-the-offseted-polylines-elevations/81318/2 "2022-09-21T18:26:55Z")

</div>

Hi  
I didn’t see the dynamo file can you look at this can help you

> [@Offset pline fails on some lines](https://forum.dynamobim.com/t/offset-pline-fails-on-some-lines/57298/8):
>
> You can do it today

---

<div class="post-metadata">

### Author: ![S.Abbosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/s.abbosh/32/146722_2.png) [@S.Abbosh](https://forum.dynamobim.com/u/S.Abbosh)
#### Post date: [September 21, 2022, 6:35pm UTC](https://forum.dynamobim.com/t/offset-polylines-and-modify-the-offseted-polylines-elevations/81318/3 "2022-09-21T18:35:40Z")

</div>

Dear Alaa,  
Thank you for the quick replay I will check Paulos e-mail and see if that could help  
Thanks a lot

---

<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: [September 21, 2022, 6:36pm UTC](https://forum.dynamobim.com/t/offset-polylines-and-modify-the-offseted-polylines-elevations/81318/4 "2022-09-21T18:36:08Z")

</div>

Hi @S.Abbosh,

I would recommend a slightly different thought process. Instead of offsetting the polyline using the _PolylineExtensions.Offset_ node and then trying to modify the elevations afterwards, I would do it like this:

1. Get the Dynamo geometry from the polyline (_Object.Geometry_ node)
2. Offset and elevate the polycurves (_Curve.Offset_ or _PolyCurve.Offset_ and then _Geometry.Transform_ might help)
3. Output the polycurves as polylines in AutoCAD (_PolylineExtensions.ObjectByGeometry_ node)

---

<div class="post-metadata">

### Author: ![S.Abbosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/s.abbosh/32/146722_2.png) [@S.Abbosh](https://forum.dynamobim.com/u/S.Abbosh)
#### Post date: [September 21, 2022, 6:40pm UTC](https://forum.dynamobim.com/t/offset-polylines-and-modify-the-offseted-polylines-elevations/81318/5 "2022-09-21T18:40:36Z")

</div>

@zachri.jensen,  
Thank you so much for the quick reply. I will try what you described here above and will let you know. I very much appreciate your time and your tip.

---

<div class="post-metadata">

### Author: ![S.Abbosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/s.abbosh/32/146722_2.png) [@S.Abbosh](https://forum.dynamobim.com/u/S.Abbosh)
#### Post date: [September 23, 2022, 3:30pm UTC](https://forum.dynamobim.com/t/offset-polylines-and-modify-the-offseted-polylines-elevations/81318/6 "2022-09-23T15:30:05Z")

</div>

@zachri.jensen  
Dear Zach,  
I hope you are doing fine. Thanks for your tips! I was able to realize in a simple way what I was looking for. I am sure there are many better ways to build such a script, but I am on my skills development path. If you have time, please look at the attached script, and I would be grateful if you could provide some feedback.  
One point to add, I have created this script to learn how the polylines will interact when they add to the TIN-Surface as contours. The first thing that comes out is! As far as I change the axis-Slider of the offset polylines! The TIN Surface removes all these Polylines as contours and drops its elevation to zero. Is there any explanation for that?  
[23092022\_C3D\_Offset Polyline and Adjust ZAxis of each Polyline.dyn](https://forum.dynamobim.com/uploads/short-url/dLDqVm16xW1DQG0M17PqevNpkWx.dyn) (70.6 KB)

I liked your webinar-29 very much with @jacob.small because it was precisely the answer to my questions about learning Python. Thanks again for everything, and I want to wish you a very nice day.  
Kindly regards  
Salwan

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