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.
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.
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.
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.
@Mostafa_El_Ayoubi me either I didn’t notice that @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.
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
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 *
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 *
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
So I apperciate if you could help me out with this guys.
Regards