Revit 2017.1 SDK, RevitAPI.chm file:
> FilteredElementCollector.IsValidObject Property
>
> If the corresponding Revit native object is destroyed, or creation of the corresponding object is undone, a managed API object containing it is no longer valid. API methods cannot be called on invalidated wrapper objects.
When the managed wrapper can be existing while its native object already is destroyed or creation of the corresponding native object is undone?
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Dear Andrey,
In the real world, this method is never used, as far as I know.
I think you can safely ignore it.
Just follow the best practices.
In this case, that means:
If the processing is complex, I would store the results first and discard the filtered element collector before proceeding any further.
Always discard all objects as quickly as possible, to isolate individual steps from each other as much as possible:
http://thebuildingcoder.typepad.com/blog/2017/01/distances-switches-kiss-ing-and-a-dino.html#4
Cheers,
Jeremy