Revision history [back]
I know this is old but I came across a similar issue when trying to remove unused schedule rulesets and I was able to figure it out. When searching for unused objects with directUseCount
, by setting excludeChilden=true
it ignores any objects that are children of that object like the StandardsInformationConstruction
in this instance, without deleting objects that are referenced by other non-children objects.
So modifying the measure to the following worked as expected:
model.getConstructions.sort.each do |resource|
if resource.directUseCount(excludeChildren=true) == 0
unused_flag_counter += 1
resource.remove
I know this is old but I came across a similar issue when trying to remove unused schedule rulesets and I was able to figure it out. When searching for unused objects with directUseCount, by setting directUseCount
, "excludeChilden=true" it ignores any objects that are children of that object like the excludeChilden=true
StandardsInformationConstruction in this instance, without deleting objects that are referenced by other non-children objects.StandardsInformationConstruction
So modifying the measure to the following worked as expected:
model.getConstructions.sort.each do |resource|
if resource.directUseCount(excludeChildren=true) == 0
unused_flag_counter += 1
resource.remove