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

Show displayname in grid view #612

Closed
macumber opened this issue Jul 9, 2023 · 7 comments · Fixed by #715
Closed

Show displayname in grid view #612

macumber opened this issue Jul 9, 2023 · 7 comments · Fixed by #715
Labels
Enhancement Request New feature or request

Comments

@macumber
Copy link
Collaborator

macumber commented Jul 9, 2023

Enhancement Request

For applications where displayname is different than the object name, it would be useful to see it in the OS app. Not sure if it should be a separate column or something else.

https://unmethours.com/question/93379/display-names-of-items-imported-from-gbxml/

@macumber macumber added the Enhancement Request New feature or request label Jul 9, 2023
@macumber macumber changed the title Show displayname is grid view Show displayname in grid view Jul 9, 2023
@christophertindall
Copy link

This needs to be elevated above an "Enhancement Request". The fix for OpenStudio Issue 4457 has broken our ability to use OpenStudio Application to modify OSM files generated by Revit Systems Analysis. OpenStudio Application now only displays the gbXMLId values, which is not useful for navigating the model. While we are waiting for this fix, can someone write an OpenStudio measure to replace the space gbXMLId values with the space displayName values? Revit already verifies the displayName value is unique so it should be a simply measure to write.

@jmarrec
Copy link
Collaborator

jmarrec commented May 23, 2024

I understand your concern if this is breaking your workflow. That being said, I'd like to clarify something:

  • Revit produces gbxml in a certain way.
  • OpenStudio SDK can handle the conversion between to/from gbxml/OSM.
  • OpenStudioApplication uses openstudio SDK and works on an OSM.

From the point of view of the OpenStudioApplication: a model object has a name, we display it, that's about it. It works as expected and designed. We control neither how Revit produces gbxml nor the OpenStudio SDK's handling of gbxml.

So yes, this is an enhancement request. And it is similar to

@jmarrec
Copy link
Collaborator

jmarrec commented May 23, 2024

the OSM has the gbxml's id as the name.

Here is some python code to replace it.

import openstudio

model = openstudio.model.Model.load('model.osm').get()

for obj in model.modelObjects():
    if not obj.hasAdditionalProperties():
        continue
    displayName_ = obj.displayName()
    if not displayName_.is_initialized():
        continue
    name = obj.nameString()
    displayName = displayName_.get()
    gbXMLId_ = obj.gbXMLId()
    print(f"For {obj.briefDescription()}, setting name to '{displayName}'")
    if gbXMLId_.is_initialized():
        gbXMLId = gbXMLId_.get()
        if gbXMLId != name:
            print(f"and replacing gbXMLId '{gbXMLId}' with '{name}'")
    obj.setName(displayName)
    obj.setGBXMLId(name)

model.save('replaced.osm', True)

same in ruby

require 'openstudio'

model = OpenStudio::Model::Model.load('gbxml.osm').get

model.modelObjects.each do |obj|
  next unless obj.hasAdditionalProperties
  displayName_ = obj.displayName
  next if displayName_.empty?
  name = obj.nameString()
  displayName = displayName_.get
  gbXMLId_ = obj.gbXMLId()
  puts("For #{obj.briefDescription()}, setting name to '#{displayName}'")
  if gbXMLId_.is_initialized
    gbXMLId = gbXMLId_.get
    if gbXMLId != name
      puts("and replacing gbXMLId '#{gbXMLId}' with '#{name}'")
    end
  end
  obj.setName(displayName)
  obj.setGBXMLId(name)
end

model.save('replaced.osm', true)

@macumber
Copy link
Collaborator Author

@christophertindall or @chrisbalbach would either of you be able to make a small example model in Revit and export to OSM? I'd like to see which objects have these fields. Julien has covered many object types in #715

@jmarrec
Copy link
Collaborator

jmarrec commented Jul 15, 2024

jmarrec added a commit that referenced this issue Jul 15, 2024
@christophertindall
Copy link

@macumber included is an OSM file generated by Revit 2024 that include the additional properties.
in.zip

@jmarrec
Copy link
Collaborator

jmarrec commented Aug 29, 2024

Fixed via #715

@jmarrec jmarrec closed this as completed Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants