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

BuildingStorey ID update for IndividualSpaceExport #380

Merged
merged 2 commits into from
Dec 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions XML_Adapter/XMLSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,17 @@
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using BH.oM.XML;
using BH.oM.Base;
using BH.oM.Environment.Elements;
using BHP = BH.oM.Environment.Fragments;
using BHG = BH.oM.Geometry;
using BH.Engine.Geometry;
using BH.Engine.Environment;

using BH.Engine.XML;
using BH.oM.Base;
using BH.oM.Environment.Elements;
using BH.oM.XML;
using BH.oM.XML.Enums;

using BH.oM.XML.Settings;
using System;
using System.Collections.Generic;
using System.Linq;
using BH.oM.Geometry.SettingOut;

namespace BH.Adapter.XML
{
Expand Down Expand Up @@ -103,7 +99,7 @@ private static void SerializeBuildingSpaces(IEnumerable<BH.oM.XML.Environment.Do

foreach (BH.oM.XML.Environment.DocumentBuilder db in documents)
{
foreach(List<Panel> space in db.ElementsAsSpaces)
foreach (List<Panel> space in db.ElementsAsSpaces)
{
if (space.IsExternal(db.ElementsAsSpaces))
{
Expand All @@ -116,11 +112,14 @@ private static void SerializeBuildingSpaces(IEnumerable<BH.oM.XML.Environment.Do

GBXML gbx = new GBXML();
SerializeCollection(space, db.Levels, db.UnassignedPanels, gbx, settings);
Level level = space.Level(db.Levels);
if (level != null)
SerializeLevels(new List<Level> { level }, new List<List<Panel>>{ space }, gbx, settings);

//Document History
DocumentHistory DocumentHistory = new DocumentHistory();
DocumentHistory.CreatedBy.Date = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss");
gbx.DocumentHistory = DocumentHistory;
DocumentHistory documentHistory = new DocumentHistory();
documentHistory.CreatedBy.Date = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss");
gbx.DocumentHistory = documentHistory;

XMLWriter.Save(fileName + spaceName + ".xml", gbx);
}
Expand Down