# Creating Polyline offset from Alignment

**URL:** <https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151>\
**Category:** Civil 3D\
**Tags:** geometry\
**Created:** [May 19, 2021, 7:38pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151 "2021-05-19T19:38:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![betsy.kirtland](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/betsy.kirtland/32/117085_2.png) [@betsy.kirtland](https://forum.dynamobim.com/u/betsy.kirtland)\
**Post date:** [May 19, 2021, 7:38pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/1 "2021-05-19T19:38:28Z")

</div>

Hi all,  
Very new Dynamo user here. I am a bridge engineer in MA trying to find ways that my team can automate or at least speed up some of our design / drafting tasks. We use AutoCAD C3D pretty exclusively (i.e., we do not use Revit at all) - it’s what our clients use and require that we use.

I think creating framing plans of our bridges might be something that Dynamo could help with, but I’m having trouble figuring out the first step. The first thing we usually do after getting the alignment from our highway team is to offset it to create the outer “edge of deck” lines, and then figure out the girder spacing between those lines. So, what I really want to do is figure out how to offset an alignment (creating a polyline) between two stations. Any help or ideas on how to do this would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![KirkWM](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kirkwm/32/104406_2.png) [@KirkWM](https://forum.dynamobim.com/u/KirkWM)\
**Post date:** [May 19, 2021, 8:18pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/2 "2021-05-19T20:18:59Z")

</div>

Checkout @zachri.jensen recent example which might be similar application.

> [@Civil 3d Point Group by Description in Current dwg](https://forum.dynamobim.com/t/civil-3d-point-group-by-description-in-current-dwg/63514/8):
>
> Already got those wink I do roadways and know next to nothing about runways, but here is an example for you to play around with. All of the inputs are driven from an Excel file. The plane is totally unnecessary, but it’s an example of dynamically placing a block reference. [RunwayExample.dyn](https://forum.dynamobim.com/uploads/short-url/xhiOvd6YBmIelhGB7oSet1n7xdR.dyn) (151.6 KB) [RunwayExample.xlsx](https://forum.dynamobim.com/uploads/short-url/uoPTIYpLUPXndeWFhudoDzlsXeY.xlsx) (8.7 KB) [RunwayExample.dwg](https://forum.dynamobim.com/uploads/short-url/rGC8PCBAcmDqROo9Vd3KK7i00Xy.dwg) (3.4 MB)

---

<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:** [May 19, 2021, 8:47pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/3 "2021-05-19T20:47:57Z")

</div>

Hi @betsy.kirtland,

If you haven’t already done so, the first thing you should do is download the Civil 3D Toolkit package. It has several additional nodes that make Dynamo much more usable in Civil 3D, including a node to create polylines.

Here is an example for you to try as you get going.

[BridgePolylines.dwg](https://forum.dynamobim.com/uploads/short-url/9X0ka04d7yVP0wOeKYNLpcagHDg.dwg) (956.1 KB)  
[BridgePolylines.dyn](https://forum.dynamobim.com/uploads/short-url/1wWcIt6KzbmyYQ1QudzQttsb7AD.dyn) (97.6 KB)

![BridgePolylines](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/1/b1fba682d189ed2a9f77309cd7c9a12922b26e7d.gif)

---

<div class="post-metadata">

**Author:** ![betsy.kirtland](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/betsy.kirtland/32/117085_2.png) [@betsy.kirtland](https://forum.dynamobim.com/u/betsy.kirtland)\
**Post date:** [May 19, 2021, 9:29pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/4 "2021-05-19T21:29:04Z")

</div>

Thanks, @KirkWM, but I don’t think this is quite what I’m looking for. I am hoping to avoid using Excel for this purpose.

---

<div class="post-metadata">

**Author:** ![betsy.kirtland](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/betsy.kirtland/32/117085_2.png) [@betsy.kirtland](https://forum.dynamobim.com/u/betsy.kirtland)\
**Post date:** [May 19, 2021, 9:33pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/5 "2021-05-19T21:33:48Z")

</div>

Thank you, @zachri.jensen !! This seems to be exactly what I’m looking for. Much appreciated!

---

<div class="post-metadata">

**Author:** ![betsy.kirtland](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/betsy.kirtland/32/117085_2.png) [@betsy.kirtland](https://forum.dynamobim.com/u/betsy.kirtland)\
**Post date:** [May 20, 2021, 3:10pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/6 "2021-05-20T15:10:25Z")

</div>

@zachri.jensen if you have a moment, could you explain to me why the “get planes at bridge start and end” and “intersect with offset curves” are necessary? I can understand every other part of the code except for those. Thanks in advance!

---

<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:** [May 20, 2021, 3:29pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/7 "2021-05-20T15:29:54Z")

</div>

Sure thing. My thought process was to lay out the graph in a similar way to how I would approach the process in Civil 3D. Here’s what that would look like:

1. Offset the alignment to create the girder and deck polylines
2. Draw lines perpendicular to the alignment at the bridge start and end stations
3. Trim the polylines from step 1 using the lines from step 2

The thought process is the same in Dynamo, except that trimming geometry is a little more work. In Civil 3D the user chooses which side of the ‘cutting’ edge to trim with a mouse click, but in Dynamo you have to specify a point on the side that should be removed. So the process in Dynamo is like this:

1. Offset the alignment to create the girder and deck curves
2. Create planes perpendicular to the alignment curve at the bridge start and end stations
3. Get the intersection point of the plane with each girder and deck curve (this provides the ‘cutting’ location the same as step 2 above)
4. Trim one side of the curves first, then trim the other side

As with most workflows, this isn’t necessarily the only way to do it 🙂

---

<div class="post-metadata">

**Author:** ![betsy.kirtland](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/betsy.kirtland/32/117085_2.png) [@betsy.kirtland](https://forum.dynamobim.com/u/betsy.kirtland)\
**Post date:** [May 21, 2021, 2:31pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/8 "2021-05-21T14:31:10Z")

</div>

Thank you! I didn’t realize that Dynamo needs planes for trimming. That explains it.  
Now I’m off to try to come up with ways to modify the code to allow for skew angles & variable girder spacing. Wish me luck!

---

<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:** [May 21, 2021, 2:44pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/9 "2021-05-21T14:44:22Z")

</div>

> [@betsy.kirtland](#):
>
> I didn’t realize that Dynamo needs planes for trimming

Not quite…the _Geometry.Trim_ node won’t actually work directly with a plane. That’s why I was intersecting the planes with the lines to get points, and then _those_ are used as the geometry to trim with.

---

<div class="post-metadata">

**Author:** ![benedict.ofwono](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@benedict.ofwono](https://forum.dynamobim.com/u/benedict.ofwono)\
**Post date:** [January 18, 2022, 10:57am UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/10 "2022-01-18T10:57:06Z")

</div>

Hi @zachri.jensen, I have spirals on my alignment and it is not drawing the polylines. Got a solution to this?

Ben

---

<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:** [January 18, 2022, 2:53pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/11 "2022-01-18T14:53:25Z")

</div>

Does the _AlignmentExtensions.GetGeometry_ node successfully return the polycurves? If I remember correctly it will tesselate the spirals to a series of line segments. But if it gets a nurbs curve then I don’t know if the _PolylineExtensions.ObjectByGeometry_ node will work.

---

<div class="post-metadata">

**Author:** ![benedict.ofwono](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@benedict.ofwono](https://forum.dynamobim.com/u/benedict.ofwono)\
**Post date:** [January 18, 2022, 4:02pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/12 "2022-01-18T16:02:30Z")

</div>

Yes, it does.  
This is the error I am getting {Warning: Geometry.Trim operation failed. PolyCurves may be branching} when the offset is set to a non-zero figure.

---

<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:** [January 18, 2022, 4:05pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/13 "2022-01-18T16:05:14Z")

</div>

Is the geometry scaling set to medium?

---

<div class="post-metadata">

**Author:** ![benedict.ofwono](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@benedict.ofwono](https://forum.dynamobim.com/u/benedict.ofwono)\
**Post date:** [January 18, 2022, 4:54pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/14 "2022-01-18T16:54:16Z")

</div>

It is.

---

<div class="post-metadata">

**Author:** ![KirkWM](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kirkwm/32/104406_2.png) [@KirkWM](https://forum.dynamobim.com/u/KirkWM)\
**Post date:** [January 19, 2022, 12:19am UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/15 "2022-01-19T00:19:57Z")

</div>

Sometimes that error comes from having the alignment style when the line extensions are turned on. If you turn it off is should work better but I’m not too confident in it handling spirals.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/a/8af3bd0230dc318390b7b53fec1d99f37c9d2c91.png)

---

<div class="post-metadata">

**Author:** ![KirkWM](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kirkwm/32/104406_2.png) [@KirkWM](https://forum.dynamobim.com/u/KirkWM)\
**Post date:** [January 19, 2022, 12:24am UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/16 "2022-01-19T00:24:19Z")

</div>

> [@KirkWM](#):
>
> but I’m not too confident in it handling spirals

ah it did work 😃

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/1/11561004a8737091770d96de3217325389442591.png)

---

<div class="post-metadata">

**Author:** ![KirkWM](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kirkwm/32/104406_2.png) [@KirkWM](https://forum.dynamobim.com/u/KirkWM)\
**Post date:** [January 19, 2022, 12:26am UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/17 "2022-01-19T00:26:04Z")

</div>

> [@zachri.jensen](#):
>
> tesselate the spirals

yes it does tesselate them

---

<div class="post-metadata">

**Author:** ![Astrid.za](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@Astrid.za](https://forum.dynamobim.com/u/Astrid.za)\
**Post date:** [May 6, 2022, 8:41am UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/18 "2022-05-06T08:41:29Z")

</div>

Hi @zachri.jensen this works great in plan, for an alignment with horizontal curves. However it does not seem to work on an alignment with vertical curves as well. I get an error that the join curves into poly curve node results in more than one wire.

---

<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:** [May 6, 2022, 1:01pm UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/19 "2022-05-06T13:01:01Z")

</div>

Hi @Astrid.za,

I’d be surprised if vertical curves are causing an issue. This workflow shouldn’t have any interaction with profiles.

> [@zachri.jensen](#):
>
> Is the geometry scaling set to medium?

---

<div class="post-metadata">

**Author:** ![cesarlatino24](https://avatars.discourse-cdn.com/v4/letter/c/e495f1/32.png) [@cesarlatino24](https://forum.dynamobim.com/u/cesarlatino24)\
**Post date:** [June 22, 2023, 2:25am UTC](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151/21 "2023-06-22T02:25:10Z")

</div>

![error 34](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/9/2915a46abfbe63df509f455e72c59b2a740530a3.jpeg)  
hello good,  
I was trying to do this exercise and I get these errors, some were changing the command but the last one I get this error that I don’t understand. and also know why I don’t get the visible result in civil3d. Can you give me any suggestion.

Regards

[Next page](https://forum.dynamobim.com/t/creating-polyline-offset-from-alignment/64151.md?page=2)
