Renumbering Rooms Clockwise

Hello dear community,

I wonna make script which renumbering Appartment rooms from entry room to clockwise, from left to rigt in a circle. I made a center point of apartment and connected to every central point of room. I have these vectors and now don’t know how to go clockwise. Does anyone knows how that goes?

Thank you in advance for your reply :)..

Damir

hi

edit: Point.Average comes from the Clockwork package (center of gravity of other points)

cordially

christian.stan

Christian, thank you very much for you answer. It works.

Now I am trying to start that renumbering from the appartment entry room (Entry door is intersecting choosen room) but I have problem sorting those ones and finishing with proper renumbering. Can you please check? Probably my licing doesn’t go right.

Thank you in advance for your reply :)…

That should do the trick (I’m not entirely confident in what I’m saying)

Sorry I can’t do better.
Sincerely, Christian Stan

Thank you Christian. Sorry but unfortunately I can’t see from low picture resolution two nodes that you add above. Can you just write it which ones are they? Thanks

Damir

Indexof et getitematindex

I would go more in this direction:

when you have the pieces with doors, I sort them according to their angular value, using your desired first door as a starting point,

and then I send this to a Python node. If my door is A1, I send all the pieces with A1, and so on. Once I’ve sorted them into sublists,

I flatten and then number them.

I’ll try to do an example tomorrow around the same time if this message is unclear.

Regards, Christian Stan.

Thank you. I will try with Index Node and if I don’t succeed will let you know.

I wish you nice evening :).

Hi,
I don’t know if this worked as I said yesterday, here it is:

I didn’t use Bimorph, I don’t have

(a little shortcut to put yourself in the same conditions as you when starting your script)

Python script

import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
import Autodesk.Revit.DB
from Autodesk.Revit.DB import *

rooms=UnwrapElement(IN[0])
room_etalon=UnwrapElement(IN[1])
para=IN[2]

def test(rooms,re,para):
    l=[]
    l.append(re)
    for r in rooms:
        if r.LookupParameter(para).AsString() == re.LookupParameter(para).AsString():
            l.append(r)
    return l

OUT = [test(rooms,re, para) for re in room_etalon]

before

after script

25_11_10 rep pieces reoorder.dyn (52.7 KB)

Regards, christian.stan

Thank you @christian.stan very, very much. Everything works.

As we are in Belgrade saying “Ti si dečko car!”, it’s like “You’re a imperator” :)…

I will mark your last reply as solution because you gave me(us) the whole solution.

I wish you nice day :slight_smile: