Dear all.
I have made at script for renumbering rooms by a spline. I have testet this numerous time and it have been working. Now one of my colleagues had to use it for renumbering rooms on a residential project, but It don’t work cosistently. I haved testet it my self a drawed to different splines located besides each other.
When using spline 02 (magenta) it works as intended, but if i use spline 03 (blue) it dosent, it only renumbers the last room. Se pictures below
I found out that the problem is caused by the control points of the spline is set after then center of the room, thus not counting it as intersecting. I haved tried corverting the line and adding more segments, but it dosn’t seeem to help
Checked if room and spline were on the same elevation which they were
I tried your script but it only works in my test file on the magenta line, (as my own also do). But not the blue. Can’t find the reason why one works and the other one doesn’t. I don’t have this problem when using it one other projects, but i want to figure out why ii doesn’t work on this particular project.
Maybe you can have a look?
I have provided my script + sample file below
Hi @Henrik,
Thanks for sharing the file.
It seems like it has something to do with how the spline is drawn. The curve’s control points maybe.
The solution seems to be changing the Geometry Scaling to Large
@GavinCrump@GavC@jacob.small Dynamo didn’t prompt that you need to switch scaling unlike in many other cases. How can we know that it needs to be changed? (Just asking to see if there is something to keep in mind next time)
The spline you draw in Revit and then select in Dynamo. I think it is best to rebuild that as a ploycurve. I have found this results in a much more stable - point closest to result. You can see the nodes I use in this script for renumbering window.
If there wasn’t unexpected data loss on the geometry the warnings don’t get triggered. That said the data loss happens 99% of the time so it usually pops up, but since no geometry operations were performed (you pulled parameters from the objects not built new geometry) you don’t get the warning as Dynamo never built anything. Rebuilding a curve will usually trigger the warning though as it’s creating new.
Said another way: modifiers and constructors trigger the warning, query may not.
Hey Amol
That seemed to do the trick, it wasn’t really aware the it could be the Geomtry Scaling (i’m still quite new to dynamo so had almost forgot it existed.
I did end up going with Simons suggestion and rebuilding the spline as polycurve
Hey Simon.
Thank you for sharing your solution!
I just have a question since i’m still quite new to dynamo.
In you codeblock you put 80 as the number of points for it to be divide to, is there a specific reason why this is 80? Or could it be any given number like 200 or so?
I just picked a medium sized number. The larger the number the tighter it will follow the Revit spline. If you put too small a number like 10 it would not tightly follow the Revit spline shape. 80 worked for me because to have too large a number might slow the script. 200 would be ok for longer Revit splines. You got work out best number via trial and error.
Might be worth scaling the point count to the geometry itself - pointsatequalsegmentlength or similar to ensure consistency at different scales of projects.
Also, leveraging segment length may be advisable here - splines and NURBS are not known for expected parameterization as the vectors which define them are non-uniform (hence the Non-Uniform in NURBS).
Hey Simon
Thanks for the clarification!
At was also somewhat it tought i was. Just wanted to make sure i got i right, idon’t like having part of my scripts I don’t fully understand