Sheet Revisions from Linked File

Is there a process for collecting sheet revisions from a linked file? I’ve tried this with the archi-lab Sheets.Revisions node with no luck. Long story short, I’m trying to create a revision matrix that works across linked file. I’ve got my front end process working in my project but am failing when trying to extract this info from a link. Also, I’ve tried the same process with revision clouds from a linked file and am getting the same results (I’d prefer to go with Sheet Revisions instead of Revision Clouds). I’m working in Dynamo 2.x and Revit 2018.3. Thanks in advance

The problem is that the Sheet.Revison node is going to run on your current document, not the Link. You will either need to find a custom node for Sheet Revision in Doc, or use Python to do it.

Try this. Just Feed it the RevitLink.GetDocument.

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
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
linkDoc = UnwrapElement(IN[0])

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

LinkSheets = FilteredElementCollector(linkDoc).OfCategory(BuiltInCategory.OST_Sheets).ToElements()

sheetRevs = []
revName = []
for sheet in LinkSheets:
	revs = sheet.GetAllRevisionIds()
	for r in revs:
		rev = linkDoc.GetElement(r)
		sheetRevs.Add(rev)
		revName.Add(rev.Name)
	

TransactionManager.Instance.TransactionTaskDone()

OUT = sheetRevs,revName
2 Likes

Thanks Sean, this is a step in the right direction but I’m not sure that I’d be able to obtain all the information I need from this python code. I’m fairly new to dynamo and have what should be considered no coding experience so I do appreciate the know how/assistance. In the end, I need to get the Revision Sequence, Date, Description, and the sheets the revisions reside on. I was really optimistic about the Sheets.Revisions node as that seemed to make the graph really short an concise. See below for the general direction I was headed down prior to trying this out on a linked file.

I believe the Revision Properties Node will work on the “Revision” output from the Python node. The problem you were having is that the Sheet.Revision node wasn’t working with the linked document. Once you have the Linked revisions you can pull the information / properties from them as you want to do. I modified the Python a little to get Sheet Names out of it as well

#Copyright(c) 2019, Sean Page
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
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
linkDoc = UnwrapElement(IN[0])

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

linkSheets = FilteredElementCollector(linkDoc).OfCategory(BuiltInCategory.OST_Sheets).ToElements()

sheetRevs = []
revName = []
linkSheet = []
for sheet in linkSheets:
	revs = sheet.GetAllRevisionIds()
	for r in revs:
		rev = linkDoc.GetElement(r)
		sheetRevs.Add(rev)
		revName.Add(rev.Name)
		linkSheet.Add(linkDoc.GetElement(sheet.Id))
	

TransactionManager.Instance.TransactionTaskDone()

OUT = linkSheet,sheetRevs,revName
3 Likes

Sean, This appears to be working just as needed! I truly appreciate the time and assistance…this was unbelievably helpful.

Sean, thanks for that python code that included the sheets. Is there a way to feed it a list of linked instances?

1 Like

is possible to make it work for input as a list?

This is untested as I don’t have a model up to review, but I think this should work. May have to check the nesting levels of the information.

#Copyright(c) 2019, Sean Page
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
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
linkDocs = UnwrapElement(IN[0])

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

links = []
for linkDoc in linkDocs:
    temp = []
    linkSheet = []
    linkSheets = FilteredElementCollector(linkDoc).OfCategory(BuiltInCategory.OST_Sheets).ToElements()
    for sheet in linkSheets:
        sheetRevs = []
        revName = []
        revs = sheet.GetAllRevisionIds()
        for r in revs:
            rev = linkDoc.GetElement(r)
            sheetRevs.Add(rev)
            revName.Add(rev.Name)
            linkSheet.Add(linkDoc.GetElement(sheet.Id))
        temp.append(sheetRevs)
        temp.append(revName)
        temp.append(linkSheet)
    links.append(temp)

TransactionManager.Instance.TransactionTaskDone()

OUT = linkSheet,sheetRevs,revName

A post was split to a new topic: Error LinkDoc

To add to this just thought I’d let you know all nodes in Crumple now accept linked documents or instances as well. This should be able to run a similar process to above script.

3 Likes

hello @GavinCrump

Ultimately the intention to get revision of each sheet of each document file is to get the Revision numbers because the OOTB node Element Properties show all the information required but do not show the Revision Number unless this revision is only used once in all project sheets on each document.

Do you know how to get the revision number straight forward? node found just gets a sequence number but no idea what is the revision number printed on a sheet revision schedule because the sequence starts based on the revisions selected from the full list in its order.

Testing Crumple nodes and also Archilab, for unknown reason some files have the last revision missing in the reported node output, then I cannot rely on scripts to get this information.

From what i can see there your script is working. The last item node has 18 items, and the previous list has 18 sheets. I’m not sure what that excel list is.

Cross check the sequence numbers to see if they are in project sequence order maybe.

I believe archilab and crumple use the same API method, so possibly an issue with that maybe. Not sure though, that node has always worked for me.

1 Like

it works absolutely perfect, thanks, the issue was the Autodesk Desktop connector to the server itself, no Revit, no Dynamo. I was reading an old cache version or something like that I guess. So frustrating of not understanding why is not working for more tests that I do, that I was hating Dynamo.