First time here? Check out the Help page!
1 | initial version |
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
2 | No.2 Revision |
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, directUseCount
, by setting "excludeChilden=true" excludeChilden=true
it ignores any objects that are children of that object like the StandardsInformationConstruction 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