I’m attempting to find and replace revision descriptions. Is there a way to set a revision description? Right now I’m getting a read-only error. There are native nodes to SetIssued, SetIssuedBy, SetIssuedTo, and SetRevisionDate but no SetRevisionDescription.
What parameters are available? Check with an Element.Parameters node.
if a revision is issued, you cannot change it i believe, so first set it to not issued, change the description, and change it back to issued.
@Marcel_Rijsmus is totally right. The thing is that even if you were to set Issued
to false via Dynamo you would have to make sure that Transaction is closed before moving on to the next step. You can do it with the OOTB node Transaction.End or via Python. Here’s how:
Set Issued:
# Import RevitAPI
import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
if isinstance(IN[0], list):
revs = IN[0]
else:
revs = [IN[0]]
def set_issued(r, val):
UnwrapElement(r).Issued = val
return r
TransactionManager.Instance.EnsureInTransaction(doc)
output = [set_issued(x, IN[1]) for x in revs]
TransactionManager.Instance.TransactionTaskDone()
TransactionManager.Instance.ForceCloseTransaction()
OUT = output
Set Description:
# Import RevitAPI
import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
if isinstance(IN[0], list):
revs = IN[0]
else:
revs = [IN[0]]
def set_description(r, val):
UnwrapElement(r).Description = val
return r
TransactionManager.Instance.EnsureInTransaction(doc)
output = [set_description(x, IN[1]) for x in revs]
TransactionManager.Instance.TransactionTaskDone()
OUT = output
That is a great point that I hadn’t even considered. Thanks for the python script.
Actually, after running this, I’m recognizing this probably shouldn’t be solved in Dynamo. The ease of changing the Revision Description in the Revit UI is actually relatively easy. Unless there was a hundred or so revisions that would need to change to unique descriptions(Dear God, don’t ever give me that project), it would be easier to just copy and paste the description through the different revisions.
Wow, I think I just admitted that the Revit UI wasn’t bad.
this way doesn’t work…
while this way works, buts its a single item from a list…
Hi @Konrad_K_Sobon,
I got very excited seeing someone has a solution to the read only problem…
I tried to use both of your scripts but I couldn’t get multiple inputs for the set parameter happening. While singular input works. Any ideas why this is happening? Thanks
I would like to update all revision descriptions to be uppercase. But I can’t change all at once.