-
Notifications
You must be signed in to change notification settings - Fork 193
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
Support gbXML translation where user-input <Name> is different from the id #4457
Comments
I support this enhancement request. I wanted to point out there is already some support for "CADObjectId" as a special additional property: https://github.com/NREL/OpenStudio/blob/master/src/gbxml/ForwardTranslator.cpp#L1337 I think reserved or supported additional properties names should have an API method to access them or at least a list of the supported property names some where. I also think it would be good to have a table showing the mappings between various names, ids, etc between gbXML, E+, and OSM. The table could include which properties are optional and which properties are the fall-back if not set. |
FYI, here is some code that could be used as a forward compatible patch in measures or other code until this method is available in C++:
|
Thanks for the detailed description. It is quite dense, so it would be helpful to try and turn it into action items / bullet points. Before we do that, I'll mention what happens currently: Reverse TranslatorThe eg: Let's take Space as an example
OpenStudio/src/gbxml/ReverseTranslator.cpp Lines 461 to 469 in db1d522
OpenStudio/src/gbxml/ReverseTranslator.cpp Lines 150 to 158 in db1d522
Result: a space named '1 Space- somewhere' (due to escapeName), and an additional property
ForwardTranslatorThe
OpenStudio/src/gbxml/ForwardTranslator.cpp Lines 613 to 614 in db1d522
OpenStudio/src/gbxml/ForwardTranslator.cpp Lines 638 to 640 in db1d522
OpenStudio/src/gbxml/ForwardTranslator.cpp Lines 168 to 189 in db1d522
|
I'm having a hard time finding the actions items. I do see a couple at least:
As far as adding The A third field could be of interest: Given the E+ restrictions on what is a valid name, versus what the gbxml accepts, I'm not sure how we deal with this, aside from educating users to use all ASCII chars for Where you perhaps suggesting to use the |
I would suggest a table showing the mappings to help make sure we are all on the same page. The following is a rough start, probably needs some iterations (feel free to edit my comment): OpenStudio::GbXML::GbXMLReverseTranslator followed by OpenStudio::EnergyPlus::ForwardTranslator:
OpenStudio::EnergyPlus::ReverseTranslator followed by OpenStudio::GbXML::GbXMLForwardTranslator: Reverse translation (backup means what to use if displayName/cadObjectId don't exist):
|
Ok, so you do want to use the gbxml |
Hi @jmarrec , But, if you ask me, I think a lot of developers expect to use the gbXML id to identify a given model element in the EnergyPlus results and this matching of results becomes difficult when gbXML Names are not unique and/or OpenStudio removes illegal characters in the Name upon export to IDF. I realize that the character restrictions on EnergyPlus Names and gbXML ids are not perfectly equal to one another but there's more overlap between them than there is between EnergyPlus Names and gbXML So I feel like an ideal solution would be to have an option on the gbXML translators to either keep the existing behavior and import the ids as gbXMLId. OR the gbXML ids could be imported to the OpenStudio/EnergyPlus Name and the gbXML Names be imported to DisplayName. The default could be the option that keeps the current behavior so that the current workflows don't break. I understand that it's more work to implement it this way with both options and, if it's ultimately too difficult, I can handle the switching of name/id in our translation measures as I mentioned above. We'll take whatever I can get here and the most important thing is that the data isn't lost upon translation. |
A fix for this issue might also benefit Revit's Systems Analysis feature, which uses the Reverse Translator. I've been using https://github.com/GreenBuildingXML/Sample_gbXML_Files for testing, which have several files where the XML element's Name is not unique. For example, the |
We'll try (1) implementing @macumber's table, (2) consider adding methods to the API (displayName and cadObjectID), and then (3) think about possibly having a switch option (and what the default behavior should be). |
One minor nitpick. I feel like the term |
Using the above tables as starting points, here they are updated with Default (existing behavior) and Option (new behavior). ReverseTranslator:
ForwardTranslator:
Does everyone agree on this? Should this apply to |
gbXMLId is completely lost in forward translation in the option case and that bothers me somehow. I don't know if it's a big deal or not. Perhaps a simple warning saying "You have an additional property gbXMLId that will be unused" or something would be useful? Otherwise if people are fine with this table (as in it fulfills their need), so am I. |
Maybe the option case for forward translation should map gbXMLId to id and use name as a backup (like the default case)? |
Thinking about this more, maybe there shouldn't be a separate option case for forward translation. The default case should be updated to:
|
Hey everyone, happy new year! I'm glad you are all discussing this before writing code, I think it is worth really thinking through this issue otherwise it's just going to continue to be a problem. I don't have the solution, but it seems to me that the point of an id is to be able to find an object in a given data model and the point of a name is to display the object's name in a given app native to a specific data model. I think you would want to try to support round trip translation of these id and name attributes for any object that can come from a CAD model: spaces, thermal zones, surfaces, constructions, materials, etc. If you start a model in CAD, import to OpenStudio, and inspect the OpenStudio model in an OpenStudio application: you want the CAD names to come in to OpenStudio's displayName field so you can compare the objects in an OpenStudio application side by side with the CAD application. The OpenStudio Application and SketchUp Plug-in don't always show the displayName for OpenStudio objects, but it should. I wouldn't want to also add a cadName field to all the UIs, although something like this might catch all cases: openstudiocoalition/OpenStudioApplication#417. You can't import the CAD name (which can have unicode, spaces, commas, etc) into the OpenStudio name field because there are restrictions on the OpenStudio name field due to E+. If you start a model in CAD, import to OpenStudio, and run a simulation: you probably want OpenStudio to export some file in a reporting measure that associates E+ results with cadObjectId so the CAD program can read the results in directly. I don't know that you want to re-export a new gbXML from OpenStudio for the CAD program to use in this case. You might want to start a model in CAD, import to OpenStudio, make changes to the objects (maybe fill in thermal properties or something), and want to export a gbXML to reimport back into your CAD application. Do any CAD applications support this? Alternatively, you might want to start a model in CAD, import to OpenStudio, make changes to the objects (maybe fill in thermal properties or something), update model geometry in CAD, and then merge the OpenStudio model with a new gbXML from the CAD application. I think merging based on cadObjectId would be the right thing in this case. So maybe it is useful to add the actual CAD applications to these tables. We can't control what Revit does but we can at least document it. @chriswmackey could fill this out with Honeybee as the CAD tool? Revit::RevitForwardTranslator (which we don't control) followed by OpenStudio::GbXML::GbXMLReverseTranslator followed by OpenStudio::EnergyPlus::ForwardTranslator:
OpenStudio::EnergyPlus::ReverseTranslator followed by OpenStudio::GbXML::GbXMLForwardTranslator: Reverse translation (backup means what to use if displayName/cadObjectId don't exist):
|
I second everything that @macumber said and I am really glad that we're discussing this before pulling the trigger. I like the proposal of adding at least two new optional fields (eg. displayName and gbXMLId) and having logic that says, "if these fields are available, use them. Otherwise, default back to the old behavior where the OpenStudio/EnergyPlus name did everything." If we do this, I agree we can get away without needing a 2nd option. So the whole import/export process could get a lot more elegant and standardized without having to break current behavior of the name. I'll take a stab at adding Honeybee into the table there. We already have a convention for these type of fields that we use in our UI and HBJSON schema. Our schema is not going to change but how we map this to OSM and IDF is definitely still able to change. This is how I think I would integrate Honeybee into the table Dan put together:
I'm not terribly attached to calling the property |
Addresses #4457, support gbXML translation where user-input <Name> is different from the id
Hi Just re-visiting this as it seem that the SDK has been updated and I have been able to obtain the tag in Code from the additionalProperties(). However the OS application itself still defaults to using the gbxml.ID. Which isn't overly friendly. So there needs to be a request for the application to default to using the name field when a model is set-up from a gbxml translation? |
Not sure I follow the question here @Cymap-NZ. Are you talking about https://github.com/openstudiocoalition/OpenStudioApplication ? If so, yes, please open a detailed issue there with enough information to clearly understand what's needed so the OpenStudio Application team can have a look. |
Enhancement Request
For the majority of objects in gbXML, there is both an
id
that is used to reference the object throughout the XML but there is also a human-readable<Name>
tag for the object. Here is an example with Space:Currently, there is no way to produce gbXML files with the OpenStudio SDK where objects have a
<Name>
that is different than theirid
so both fields suffer from the same restrictions. This also means that theid
of the object is lost when importing from gbXML to OpenStudio and the resulting gbXML gets imported with the user-input<Name>
set as the EnergyPlus Name, meaning the imported object name often contains characters that are not appropriate for EnergyPlus.Detailed Description
In many workflows, it makes sense for the Name of the OpenStudio workspace object to become gbXML
id
(and vice versa on import) since OpenStudio Names are ultimately what identify the objects within IDF and in the EnergyPlus results. Both gbXML ids and OpenStudio/EnergyPlus Names need to follow typical character restrictions and they need to be unique since they are used to identify objects across a model. So it would be helpful if the gbXML importer (aka. ReverseTranslator) could have an option to import the gbXML ids as OpenStudio/EnergyPlus Names instead of always trying to make the gbXML<Name>
act like an identifier.Conversely, given that the
<Name>
tags in gbXML are often specified by end users, such<Name>
tags can often be duplicated in the objects across a gbXML model or they can contain characters that aren't legal for EnergyPlus. It would be nice to have some way to support this usage of the gbXML<Name>
tag in the OpenStudio SDK since, right now, such usage can result in imported gbXML models that are not simulate-able in EnergyPlus. Or, if they are simulate-able, the EnergyPlus results cannot be easily matched back to the original gbXML because OpenStudio escapes special characters in the gbXML<Names>
when it translates them to IDF.Possible Implementation
Working with the features currently supported in the OpenStudio SDK, we can see that all ModelObjects in OpenStudio have an addiditonalProperties attribute that can be used to store custom types of user inputs (like user-input names).
Within the Ladybug Tools software that I support, we are currently planning to store the user-input names of objects under these
AdditionalProperties
. We plan to call this user-input name underAdditionalProperties
aDisplayName
and we'll use it to ensure that these user-input names can survive the translation from OpenStudio and back to our software, while still ensuring that the IDF and E+ Results use ids that are appropriate for E+.Perhaps, if we could agree that that
DisplayName
(or some other property) could be a standardadditionalProperty
that was available on OpenStudio Model Objects, we can use it to support the the current intended behavior of the<Name>
tag in gbXML. This would free up the gbXML id to act as an identifier across the gbXML > OSM > IDF > E+ Results translation process.Note
I realize that this request is probably not that technically difficult to implement but I'm sure that many of us will have strong opinions. So let's all be open-minded that there may be a few good possible implementations to making this type of interoperability with gbXML work.
CC: @tijcolem , @tanushree04 , @macumber
The text was updated successfully, but these errors were encountered: