I am trying to create a Python Script node in dynamo that would return any Dimension elements used inside of a Filled Region object. I see from the Revit Lookup tool that Snoop Dependent Elements gets to where I want to go. Looking at the API, I see a GetDependentElements method and note that I can get all elements by passing a “null” to the method. So the question is: How do you do that in Python?
region = FilteredElementCollector(doc).OfClass(FilledRegion).WhereElementIsNotElementType().ToElements()
out = []
TransactionManager.Instance.EnsureInTransaction(doc)
for r in region:
z = UnwrapElement(r)
out.append(z.GetDependentElements())
# out.append(z.GetSubelements())
TransactionManager.Instance.TransactionTaskDone()
Sincerely;
Michelle
PS: The overall goal here is to examine all filled regions and masking regions for embedded dimensions and change their style to a company approved style.
The line “filterElem = ElementCategoryFilter(BuiltInCategory.OST_Dimensions)” in your example did the trick. I now need to process the results and get at the dimension style settings.
By the by, mid-way down the documents page, it says that the filter element Can be NULL to return all dependent elements. So I am still wondering, out of curiosity and future use, how do you pass a NULL? I did try “none” and “None” and that did not work.