Renumber Rooms Based on Which Area They Exist Within

Im a relative beginner working on a script which will find out which area a room exists in, then renumber it sequentially based on this area.

To explain this with an example, consider 3 rooms which exists within an area named A.101. The idea is that each of these rooms would be numbered A.101.1 // A.101.2 // A.101.3 respectively.

Using Lunchbox Area & Room collector, I have created a polygon containment test to assess if the centre point of a room exists within an area. The list logic returned however is quite complicated, and I dont understand how I can filter out false items in order to rename them.

Note that I have tried alternative methods with Rhythm’s ‘Element.AreaLocation’, however only null values are reported.

Any assistance would be much appreciated!

Ben.

Whoops, that node must’ve broke along the way. I just fixed it and will upload a new version now. It will be the version dated today 20170201.

Thanks for the prompt response John!

There is however some strange behaviour when applied to my test file - When setting the parameter by name, rooms in area 101 are named 102 and vice versa?

1 Like

:disappointed: @b.ross I suppose I need to supply you the rooms that actually have area locations :joy: I’ll reupload now.

Now working perfectly John, thank you for developing such a useful node!

The script is almost doing what I need it to, however my method for adding a unique suffix doesn’t work quite well enough. as you can see below, the ‘.##’ suffix does not reset when a new area number is started. eg.

A.101.1
A.101.2
A.102.3
A.102.4

Where I would like it to be:

A.101.1
A.101.2
A.102.1
A.102.2

Any idea how I might achieve this?

This is what I managed to get. (It’s a bit tedious to figure out which areas only have one room :smile:

and here is the DYN
renumberRoomsByArea.dyn (17.2 KB)

Thanks John. I’ve also added a sort at the start which allows me to number rooms in descending order.

1 Like

Nice job! :thumbsup:

Hmm. although this works fine for my test file, when I try to apply it to my main project everything feeds back as null. I’ve exploded your node as below,

I’ve exploded your node as below,

The only warning is for the element.getlocation node, which states: ‘Warning: Element.GetLocation operation failed.
The location of the structural element is not a valid curve.’

Any idea what is causing this? I thought it might be rooms within groups, but Ive experimented with this in a test file to no avail.

Do you have any “unplaced” rooms?

Ive just wiped out all unplaced rooms and areas, but am still getting the same null result.

Is the get location failing for all rooms? You might want to isolate which rooms it is failing on.

1 Like

Unfortunately the project im applying this to is massive, so finding a way to isolate rooms is very difficult. I’ve done a few more experients in my test file, and the issue seems to be where there are multiple area schemes in a project. Is there a way to filter out GIA/GEA area within your node?

Having looked again at the exploded node in more detail, It looks like there is some issue with the Clockwork Python script. I’ve isolated a single area which the script is unable to create a bounding box for.

Test File Full:

Applied to isolated area on project file full:

1 Like

That’s an enclosed area?

They are - all unenclosed areas and rooms have been deleted.

Strangely when I deleted and redrew some area boundary lines in Revit the script started working again, but when I began to expand the sample of isolated areas the same error occurred, as seen below.