Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS:Rendering:Color objects added every time the geometry tab is clicked and the model is saved again #768

Open
mrdeslau opened this issue Nov 13, 2024 · 2 comments
Labels
component - Geometry Editor OpenStudio SDK Issue An issue that is not related to OpenStudioApplication but to NREL/OpenStudio SDK

Comments

@mrdeslau
Copy link

mrdeslau commented Nov 13, 2024

Issue overview

Many OS:Rendering:Color objects are being added every time the geometry tab is clicked and the model is saved again. This is causing the .osm file to become cluttered when viewed in a text editor, especially for larger models. (See diff changes below)

image

Ideally, the model would not add these objects each time the geometry tab is clicked and saved.

To replicate - using the attached example model -

  1. Load in OS App and click the geometry tab
  2. Save as a new name
  3. Compare the two files in a text editor
  4. A new OS:Rendering:Color object will be added each time the geometry tab is selected and the model is saved again.

Possible Solution

One possible, but maybe not ideal solution would be to remove all rendering colors before a save -
rendering_colors = model.getRenderingColors
rendering_colors.each do |color|
color.remove
end

Another possible solution would be to identify which constructions or surfaces are causing these colors to be generated each time and removing just those from the model before a save.

Environment

Some additional details about your environment for this issue (if relevant):

  • Windows 10 Enterprise 22H2
  • OS App 3.6.1

Context

The issue is more annoying than a real problem, but it causes a visibility issue when trying to compare meaningful changes across models.

Example.zip

@mrdeslau mrdeslau added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label Nov 13, 2024
@macumber
Copy link
Collaborator

The root cause of this is this line in the OpenStudio SDK: https://github.com/NREL/OpenStudio/blob/develop/src/model/ThreeJSForwardTranslator.cpp#L133

The code should only be adding the RenderingColor objects for the AirLoopHVAC if that color does not already exist. This will add lots of color objects for large models so it might be worth patching in some way before it is fixed in the OS SDK.

@macumber
Copy link
Collaborator

Reported at NREL/OpenStudio#5309

@macumber macumber added OpenStudio SDK Issue An issue that is not related to OpenStudioApplication but to NREL/OpenStudio SDK component - Geometry Editor and removed Triage Issue needs to be assessed and labeled, further information on reported might be needed labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component - Geometry Editor OpenStudio SDK Issue An issue that is not related to OpenStudioApplication but to NREL/OpenStudio SDK
Projects
None yet
Development

No branches or pull requests

2 participants