-
Notifications
You must be signed in to change notification settings - Fork 25
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
Comments
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. |
I understand your concern if this is breaking your workflow. That being said, I'd like to clarify something:
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 |
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) |
@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 |
Fixed via #715 |
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/
The text was updated successfully, but these errors were encountered: