I am trying to measure the distance between every point on a curve but only getting one measurement. I found the problem to be with the for loop / "ME" user ERROR once again. I seem to have placed things wrongly in the code. Any idea what I have done wrong?
I have different size bends set for different situations and pipe sizes the plan is to drop down to the next possible bend radius if the measurement is too small to fit without clashing into the next or previous bend or remove the next point in the curve, if still too small. And divert the pipe, to stop strange bends from happening. It allows a straight section between bends for welds and flanges to spawn but if the bends touch it doesn't...
in your code you are just overwriting the num, one, two, three variables each iteration. so you will be left with the last one the fact that the second code seems to work is that you stop at @ptnum-1 which at least will give you different value per point even though I assume not correct one since you are not only using @ptnum-1 as your center point, but also assuming that your geo has only a single curve with points ordered by vertex order, which is not a safe assumption generally and sampling primpoints array at the index @ptnum-1 is therefore pretty random or heavily dpendent on perfect conditions of the input geo
Thanks for your input I shall try the new code.. I had a lot of weird issues but was putting it down to me being tired. This is good information on my Bad coding practices showing how I need to improve more. Thank you..