Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

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, 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