Points get created at the wrong distance, don't know why

Hello All,

I have made a combination of nodes which should split my curve into three pieces, the start which is a random length, then the middle which should always be 60 meters, and the third part which is also a random length.

I have build a script for this, but for some reason my points do not generate at the lengths i have put in. This is the part which i am talking about, thanks in advance!

Does the value from Geometry.DistanceTo represent a point at a random distance on the line? And then you get points 0.5 units before and 59.5 units after that point? I’m trying to understand what you’re actually doing here. One of your values is also a 0 which I would assume messes things up.

Yes that is exactly what my script is doing, it checks for a intersection between a line and an arc. And thats is also why one of my values is a zero, because that is the starting point. I could upload my script/ civil 3d/ revit files if that would help.

What should happen with the 0 then? If you essentially cut 60m out of a line at the start point you wouldn’t get three segments. And with the way you offset the 60m by 0.5 you would be cutting out a “negative” part of the line.

If it is zero it should be n+0,5 but that is not my main problem i think, let me check that. I will create a if statement.

Seems to be working for me. If the curves are coming from Revit/Civil 3D then it could be a units issue.

Yeah i think the problem was the zero, just like you said :). I have created a small filter to do n+0.5 instead when it’s zero! Thank you so much!!

Hey Nick i have made a small filter on my design but for some reason my script still does weird.

Here is a screenshot, i have no idea why this happens. Thanks in advance!

You shouldn’t need list levels for SplitByPoints. I’m not sure if that’s the problem though. Even if you were to trim the line around 0 it should still succeed, just with two segments instead of three.

Can you try expanding the preview for all your nodes so we can see what’s going on?

Yeah that is not really the problem because before that node the distance between my created points is not 60m. for all, just for the first one.

Automatisch Dyanmo Script 10-10-2019.dyn (513.3 KB)

I have the script here, i think that this is easier, and the part that i am editing now it the upper part

Well for some reason editing that node which you described my output for the nodes in front of that one are edited, now it seems to be working for the first 3, but the last one is still null

Hey Nick i closed my Civil 3D, Revit and Dynamo and started it all up again and now my 3rd curve length is null, i have no idea what is happening here, i didnt even change anything

It all works for me. I am using my own curves though.

Expand all your previews and post the coordinates for the curves you’re using so I can try to recreate them.

Oefenarmatuurlijnen (1).dwg (895.8 KB)

These are the exact lines i am using right now. (Civil 3D 2020 Metric file)

I’m afraid I don’t have Civil 3D so I can’t use your graph to read the dwg file. Right now I can only guess that there is an issue with how you’re handling your curves. Try manually creating the curve elements in Dynamo and see if you get the same null values.

Okay i will try that! Maybe converting them first would solve this problem, like to line back to curve or something like that

What version of dynamo are you using? Because i think you have an older version than mine, i have 2.0.3

I did my original testing in 1.3 but I ran your graph in 2.1.

Okay maybe 2.1 also works for me, i’ll try that, thank you for all your feedback!

Hey i know why it bugs, i am trying to split my line simultaniously at 4 different places, 2x twice at the same line. I am going to try to fix this tomorrow. Thanks again Nick for your help

1 Like