{"action":"created","issue":{"url":"https://api.github.com/repos/NREL/OpenStudio/issues/1502","labels_url":"https://api.github.com/repos/NREL/OpenStudio/issues/1502/labels{/name}","comments_url":"https://api.github.com/repos/NREL/OpenStudio/issues/1502/comments","events_url":"https://api.github.com/repos/NREL/OpenStudio/issues/1502/events","html_url":"https://github.com/NREL/OpenStudio/issues/1502","id":60023387,"number":1502,"title":"modelToGbxml method produces incomplete gbXML file (C#)","user":{"login":"alnjxn","id":1423708,"avatar_url":"https://avatars.githubusercontent.com/u/1423708?v=3","gravatar_id":"","url":"https://api.github.com/users/alnjxn","html_url":"https://github.com/alnjxn","followers_url":"https://api.github.com/users/alnjxn/followers","following_url":"https://api.github.com/users/alnjxn/following{/other_user}","gists_url":"https://api.github.com/users/alnjxn/gists{/gist_id}","starred_url":"https://api.github.com/users/alnjxn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alnjxn/subscriptions","organizations_url":"https://api.github.com/users/alnjxn/orgs","repos_url":"https://api.github.com/users/alnjxn/repos","events_url":"https://api.github.com/users/alnjxn/events{/privacy}","received_events_url":"https://api.github.com/users/alnjxn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NREL/OpenStudio/labels/component%20-%20gbXML","name":"component - gbXML","color":"888888"},{"url":"https://api.github.com/repos/NREL/OpenStudio/labels/severity%20-%20Normal%20Bug","name":"severity - Normal Bug","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"macumber","id":1327850,"avatar_url":"https://avatars.githubusercontent.com/u/1327850?v=3","gravatar_id":"","url":"https://api.github.com/users/macumber","html_url":"https://github.com/macumber","followers_url":"https://api.github.com/users/macumber/followers","following_url":"https://api.github.com/users/macumber/following{/other_user}","gists_url":"https://api.github.com/users/macumber/gists{/gist_id}","starred_url":"https://api.github.com/users/macumber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macumber/subscriptions","organizations_url":"https://api.github.com/users/macumber/orgs","repos_url":"https://api.github.com/users/macumber/repos","events_url":"https://api.github.com/users/macumber/events{/privacy}","received_events_url":"https://api.github.com/users/macumber/received_events","type":"User","site_admin":false},"milestone":null,"comments":9,"created_at":"2015-03-05T22:02:01Z","updated_at":"2015-03-06T19:11:36Z","closed_at":null,"body":"I am working with a well formed OpenStudio model. This model produces no errors in the OpenStudio GUI and can be run w/o issue. Exporting to gbXML via the GUI produces a complete gbXML file. Exporting the same model programmatically through the C# libraries produces an incomplete XML file. The XML shows only Zones where as the GUI version has Spaces, Zones, Surfaces, etc.\r\n\r\nOpenstudio Version: v1.6.0\r\nPlatform: Windows 8 x64\r\n\r\nGUI Export \r\n\r\n```xml\r\n<gbXML xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" volumeUnit=\"CubicMeters\" areaUnit=\"SquareMeters\" useSIUnitsForResults=\"true\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" temperatureUnit=\"C\" xmlns=\"http://www.gbxml.org/schema\" version=\"0.37\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.gbxml.org/schema http://www.gbxml.org/schema/0-37/GreenBuildingXML.xsd\" lengthUnit=\"Meters\">\r\n  <Campus id=\"Facility\">\r\n    <Name>Facility</Name>\r\n    <Building id=\"Project_Name\" buildingType=\"Unknown\">\r\n      <Name>Project Name</Name>\r\n      <Area>4819.37</Area>\r\n      <Space id=\"Instruction_221\" zoneIdRef=\"Instruction_221\">\r\n        <Name>Instruction 221</Name>\r\n        <Area>43.3277</Area>\r\n        <Volume>164.645</Volume>\r\n      </Space>\r\n      <Space id=\"Conference_123\" zoneIdRef=\"Conference_123\">\r\n        <Name>Conference 123</Name>\r\n        <Area>44.032</Area>\r\n        <Volume>167.322</Volume>\r\n      </Space>\r\n...\r\n```\r\n\r\nmodelToGbxml Method Export\r\n\r\n```xml\r\n<gbXML areaUnit=\"SquareMeters\" useSIUnitsForResults=\"true\" volumeUnit=\"CubicMeters\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://www.gbxml.org/schema\" xsi:schemaLocation=\"http://www.gbxml.org/schema http://www.gbxml.org/schema/0-37/GreenBuildingXML.xsd\" temperatureUnit=\"C\" version=\"0.37\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" lengthUnit=\"Meters\">\r\n  <Zone id=\"Administration_322\">\r\n    <Name>Administration 322</Name>\r\n  </Zone>\r\n  <Zone id=\"Electrical_227\">\r\n    <Name>Electrical 227</Name>\r\n  </Zone>\r\n  <Zone id=\"Stair_201\">\r\n    <Name>Stair 201</Name>\r\n  </Zone>\r\n  <Zone id=\"Instruction_205\">\r\n    <Name>Instruction 205</Name>\r\n  </Zone>\r\n...\r\n```\r\n\r\nC# Method\r\n\r\n```csharp\r\n//Save GBXML\r\nOpenStudio.Path gbxmlpath = new OpenStudio.Path(path);\r\nOpenStudio.GbXMLForwardTranslator gbxmlout = new OpenStudio.GbXMLForwardTranslator();\r\ngbxmlout.modelToGbXML(_model, gbxmlpath);\r\n```"},"comment":{"url":"https://api.github.com/repos/NREL/OpenStudio/issues/comments/77617195","html_url":"https://github.com/NREL/OpenStudio/issues/1502#issuecomment-77617195","issue_url":"https://api.github.com/repos/NREL/OpenStudio/issues/1502","id":77617195,"user":{"login":"macumber","id":1327850,"avatar_url":"https://avatars.githubusercontent.com/u/1327850?v=3","gravatar_id":"","url":"https://api.github.com/users/macumber","html_url":"https://github.com/macumber","followers_url":"https://api.github.com/users/macumber/followers","following_url":"https://api.github.com/users/macumber/following{/other_user}","gists_url":"https://api.github.com/users/macumber/gists{/gist_id}","starred_url":"https://api.github.com/users/macumber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macumber/subscriptions","organizations_url":"https://api.github.com/users/macumber/orgs","repos_url":"https://api.github.com/users/macumber/repos","events_url":"https://api.github.com/users/macumber/events{/privacy}","received_events_url":"https://api.github.com/users/macumber/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T19:11:36Z","updated_at":"2015-03-06T19:11:36Z","body":"Hey Alan, can you make sure to instantiate a Facility object in your model?  This line of code might not write out the campus if you don't have one:\r\n\r\nhttps://github.com/NREL/OpenStudio/blob/develop/openstudiocore/src/gbxml/ForwardTranslator.cpp#L150"}}