Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Apologies if this duplicates any previous discussions but I've done quite a few searches and couldn't find the answer.
I noticed if I create multiple collectors in the same script they don't work properly and most likely end up empty. I've tried to use Dispose() before creating the second collector to see if it can sort of "reset" the collector but I always get the error below. What is it that I'm missing?
Exception : Autodesk.Revit.Exceptions.InvalidObjectException: The managed object is not valid.
Below is a simple example where I collect all shared parameters in a project first so I can use the GUIDs to collect data from them in families.
collector = FilteredElementCollector(doc)
sharedPars = collector.OfClass(SharedParameterElement)
# Find GUID of desired shared parameters
families = collector.OfClass(FamilyInstance).WhereElementIsViewIndependent()
# Collect data from families based on parameter GUID.
Solved! Go to Solution.