Get keynotes in phase

Hi, I want to filter keynotes by phase. Not sure how to do that. My next effort is to just delete any keynotes that are in phase 1 one so my keynote legend all will look ok for phase 2. Cant seem to collect all keynote tag categories though. This not possible with dynamo?

Found a python script that will get the keynotes. Is it possible to get the element there keynoted to so I can get its phase and then filter by it to delete all keynotes in a particular phase?

The node should work, the thing is you’re calling it on the outer list L3. not in L2. The attached example doesn’t need to set the level to L2, but just to let you know where it is done.
Another way is just flatten the list before plug in into the taggedElement node:

1 Like

Gotten here so far. My normal nodes arnt working for some reason

Thanks @SeanP

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

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

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

tags = UnwrapElement(IN[0])
taggedelements = []
doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)

for i in tags:
	tagID = doc.GetElement(i.Id)
	taggedElem = doc.GetElement(tagID.TaggedLocalElementId)
	taggedelements.Add(taggedElem)

TransactionManager.Instance.EnsureInTransaction(doc)

OUT = taggedelements

2 Likes

Hello @vanman,

I’ve been trying to get the all keynotes on my model, but nothing seems to work (All elements of category, Get all Keynotes or All by Family Type). Would you mind sharing the Python Script you used to get all keynotes in the model?

Hi vitor, I posted the python code in my last post on this forum. Thats all I know from memory sorry

1 Like
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

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
element = UnwrapElement(IN[0])

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

fec = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_KeynoteTags).WhereElementIsNotElementType()

elements = fec.ToElements()


TransactionManager.Instance.TransactionTaskDone()

OUT = elements
2 Likes