Change Room Phase

Hello again,

I started to work on a new project, which is really big!

The project contains multiple phases.
Now we have a list of Rooms, which were created already, but we need to change their phases. Is there is any solution to do that?
The problem is that the Phase field is “read-only” which doesn’t give me the ability to change it.

Thanks
Ahmed

As far as I know there is no way to accomplish this via the API.
Instead you would have to create a new room in the desired phase, copy all the parameter values you want and possibly delete the existing room.

2 Likes

Hi @Ahmad_Saad,
maybe you could :

  • get the location points, names and other data of your rooms and store them in an excell sheet
  • delete all the rooms
  • add the phase of each room in excell sheet
  • import data from excel to recreate all rooms with Clockwork’s room.atpointphase
1 Like

Thanks @Andreas_Dieckmann; and @Mostafa_El_Ayoubi for your replies.
I tried to follow your proposal Mostafa, but I think I am having problem with the Clockwork’s node “room.atpointphase” it keeps giving me “empty” list, or null sometimes.

Can you show us what you’re feeding the node?

Please check this screenshot :

My bad I assumed that Room.AtPointPhase would create a new room but after taking a look under the hood of the node I realized it actually gets rooms…

There might be a way to do something with a loop that changes the phase at each run before it creates the rooms.
It seems to be possible because doc.Create.NewRoom creates the room in the phase of the current view.
I will have a look at it and let you know.

1 Like

Try Tool.CreateRoomAtPointAndLevel from package SteamNodes…

1 Like

@Mostafa_El_Ayoubi me either I didn’t notice that :slight_smile:
@Andreas_Dieckmann I already tried that yesteday, and I thought about it as a second choice; if I couldn’t achieve creating the rooms directly with the phase option.

However; I found a node which creates a non-placed room by name, number, and phase (ClockWork package) but unfortunatly it doesn’t work on Dynamo 1.2.
So I tried to update it, here is the daiagram.

And this is the Python script which creates the room by name, number, and phase:

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
doccreation = doc.Create
names = IN[0]
numbers = IN[1]
phase = UnwrapElement(IN[2])
counter = 0
elementlist = list()

TransactionManager.Instance.EnsureInTransaction(doc)
for name in names:
newroom = doccreation.NewRoom(phase)
newroom.Name = name
newroom.Number = numbers[counter]
elementlist.append(newroom)
counter += 1
TransactionManager.Instance.TransactionTaskDone()

OUT = elementlist

Also I found a node by @Julien_BENOIT which creates room by level and point

here is python script:

Developers nodes in dynamo 0.7
#proposed by Julien Benoit @jbenoit44
#http://aecuandme.wordpress.com/
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

Import ToDSType(bool) extension method

clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)

Import geometry conversion extension methods

clr.ImportExtensions(Revit.GeometryConversion)

Import DocumentManager and TransactionManager

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *

Import RevitAPI

clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

uvs =
for i in IN[0]:
uvs.append(UnwrapElement(i).ToXyz())
level=UnwrapElement(IN[1])
roomlist=

Start Transaction

TransactionManager.Instance.EnsureInTransaction(doc)

for item in uvs:
uv=UV(item.X,item.Y)
a=doc.Create.NewRoom(level,uv)
roomlist.append(a)

End Transaction

TransactionManager.Instance.TransactionTaskDone()

OUT = roomlist

So I am thinking of “merging” the two scripts together; to have one single script which creates a room by: name, number, level, point, and phase
But my "scripting’ knowledge is almost zero :slight_smile:
So I apperciate if you could help me out with this guys.
Regards