Modifying an existing script for Auto Fitting placement

Hi all,

I found this completed Dynamo routine by @erfajo from back in 2017 and was wondering if someone could help me adjust it.

The script works perfectly.
The functionality is exactly what I need as well, placing a fitting every Xm, but I would like to be able to add a single fitting with a different distance and have this script measure from there.
For example, If I need fittings to be placed every 6m along a straight pipe after a bend, I would like to be able to place a single fitting at 2m after the bend first, then have the rest of the pipe run split up into 6m increments, as seen in the small image below.

Could someone help me with this, as I am unsure about how to go about creating this functionality?
I would appreciate any help!
Thank you!

Can you post a picture of the script? I’m unsure which of the ones posted in the linked forumpost you’re using.


Sorry about that, I am using this one…
I am not too concerned about the bits at the end, as I can delete that and the script still works. I just need to figure out how to create that initial point 2m away from the bend, and then have the increments being measured from that point.

Sorry it is this one… I copied the wrong one…


Could someone please help me with this? In the script at the moment, I have the pipe increments set to 6m which is what I want and this works great.
But I would like the first pipe after each bend to be 2m long, not 6m, and then each pipe after that should be 6m.
What I have tried to do at this time is take the newly created pipes, get their lengths, take the 0 index from each list, minus the amount needed to get to 2000mm, chop the list, then replace the item at index 0 in the original lists and set the parameterbyname… The problem is, the “Length” parameter of a pipe is read only so I cannot change it this way. Any other ideas on how I can do this?