Changing decimal length to alignment stationing

what do i use to get the “+” to be shown from 2 digits to the left of the decimal.
as the watch list shows 24+36.160000 is correct but the next shows 75+7.350000 which should actually be 7+57.35000.

There’s a great node in the C3dToolkit for station formatting :smiley:

thank you that is the perfect solution

1 Like

For fun this is my attempt without the toolkit:
STA Format (no toolkit) v0.dyn (24.1 KB)

And welcome to the community!

1 Like

This doesn’t seem to work anymore. I’m using C3D 2025.2 and the C3DToolKit 1.1.32 gives an error saying it was for an older version of Dynamo.

The closest I’ve found is Alignment.StationFormat. But that requires an alignment and not a list as the examples on here use.

I’ve got a list of pressure pipes, fittings, and appurtenances with stations that I’d like to format like as stations and sorted by station.

I tried formatting the station list for appurtenances, fittings and pipes each before combining into the final list, but List.SortByKey doesn’t sort stations correctly when they’ve been formatted to look like XXX+XX.XX.

So that led me to try to sort the combined list. But Alignment.StationFormat requires an alignment, which the big list does not have. If I just grab the alignment then there’s only 1 station that gets formated because it’s based on the number of input alignments. I need to somehow grab all parts, get their alignments, then feed that into Alignment.StationFormat, but I’m not sure how to do that.

Does anyone know how to do this?

I don’t believe that the Civil3DToolkit hasn’t been updated in a little while, but have you tried the graph that @KirkWM posted above? That appears to be a good alternative to the toolkit and could be applied after you’ve done your sorting.

I looked at his graph, but I’m not sure how to get my list into String.Split.

After I get the list into this I’ve got to figure out how to replace the non-formated stations in the list with this updated one.

It looks like you need to convert the values to string before wiring them into the String.Split. That error says it’s receiving a double when it’s expecting a string.

1 Like

It is possible using API in my opinion. There is new API web page

1 Like

That helped a bunch! I got the stations formatted. But now I’m having trouble getting the original XXXX.XX station values replaced with the new list. I’m new to Dynamo, so I’m not familiar with Levels.

Current list looks like this:


The stations are the 3rd column in my table.
Updated station list looks like this:

How do I get those replaced? I’ve been playing around with List.ReplaceItemAtIndex and various levels, but no luck so far.

Try the input levels as follow: list @L2, index @L1, and item @L1.

1 Like

That did it, except that it only works on the first item in the list. Apparently, List.ReplaceItemAtIndex only works on a single item at a time.

Is there a kind of for each I could use to do this?

Sorry - longest lacing as well. :slight_smile:

1 Like

That worked perfectly! Thank you!

1 Like