Renumber rooms by spline - Not working consistently

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

Working

Not working

Below I have a picture of my graph

I can see the problem lies with that doesn’t recognize that the rooms intersect in the "Geometry.Does.Intersect " node.

But I can’t seem to find the culprit for this. Does anyone have a suggestion to what causes this?

Best regards
Henrik

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

Try setting the lacing to longest on the Geometry.xxx nodes.
Or the rooms and spline might be at different elevations.

Try this approach instead:



RenumberBySpline.dyn (36.2 KB)

If nothing works out, I suggest you share your sample Revit file and Dynamo graph.

1 Like

Hey man.

Thanks for your suggestions.

I tried editing the lacing with no luck.

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

Room Renumber By Spline.dyn (48.4 KB)
Test_file_detached.rvt (2.6 MB)

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
image

@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)

2 Likes

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.

renumber windows using a spline detail curve.dyn (36.6 KB)

EDIT: See pic below.
polycurve by points

2 Likes

That’s a good suggestion. I stumbled upon the scaling workaround when I tried doing what you suggested and Dynamo said the scaling was off.

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.

4 Likes

That was helpful. Thanks Jacob.

1 Like

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

Thank you!

1 Like

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.

1 Like

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).

2 Likes

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

Hey Jacob.
Thanks for the suggestion, I see your point.
I will try to in cooperate this into my script :-)!

1 Like

Thanks for this. My version, working in Revit 2023:
Room Renumber By Spline.dyn (63.8 KB)
Before:


After:

2 Likes

Hey mand thanks for posting, i like what you did with it, i’m chanding my own a bit now based on yours :smiley: