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

Identifying un-used constructions

asked 2020-10-02 11:57:34 -0500

antonszilasi gravatar image

updated 2021-06-04 08:23:31 -0500

I want to identify un-used constructions in my model, I shamelessly ripped code from this measure : https://bcl.nrel.gov/node/82267 the code makes sense except for this section for constructions:

  model.getConstructions.sort.each do |resource|
    if resource.directUseCount == 1 # still don't understand why this is 1 not 0
      unused_flag_counter += 1
      resource.remove
  end

Why is resource.directUseCount == 1 when a construction is un-used? Is this code really correct? For all other resources the directUseCount == 0 when a resource is un-used.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-10-02 12:24:58 -0500

That looks a bit suspect to me. The C++ purgeUnusedResourceObjects does not have that exception for constructions. I would think that the use count of 1 is possibly due to a StandardsInformationConstruction or some object like that. I would do something like below to figure out what that object is and then decide if you want to remove the construction or not:

  model.getConstructions.sort.each do |resource|
    if resource.directUseCount == 0 
      unused_flag_counter += 1
      resource.remove
    elsif resource.directUseCount == 1
      puts "WHAT IS THIS OBJECT?"
      puts resource.sources[0]
      unused_flag_counter += 1
      resource.remove
    end
  end
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

 

Question Tools

1 follower

Stats

Asked: 2020-10-02 11:57:34 -0500

Seen: 217 times

Last updated: Jun 03