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

Add space metrics override function #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions WorkplaceStrategy/SpaceMetrics/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

bin/
obj/
*.glb
output.json
input.json
.vs/
server/
test/Generated/
19 changes: 19 additions & 0 deletions WorkplaceStrategy/SpaceMetrics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@


# Space Metrics

Override various workplace metrics from a layout.

|Input Name|Type|Description|
|---|---|---|


<br>

|Output Name|Type|Description|
|---|---|---|


<br>

## Additional Information
34 changes: 34 additions & 0 deletions WorkplaceStrategy/SpaceMetrics/SpaceMetrics.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpaceMetrics", "src\SpaceMetrics.csproj", "{6FF5C3A5-79FC-426A-9F58-25DF57530B78}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpaceMetrics.Dependencies", "dependencies\SpaceMetrics.Dependencies.csproj", "{CDB3F17C-D096-4BEB-94D8-BFDB3E1888F8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpaceMetrics.Tests", "test\SpaceMetrics.Tests.csproj", "{360608A1-942E-4751-B878-E5239BF0595D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6FF5C3A5-79FC-426A-9F58-25DF57530B78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6FF5C3A5-79FC-426A-9F58-25DF57530B78}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6FF5C3A5-79FC-426A-9F58-25DF57530B78}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6FF5C3A5-79FC-426A-9F58-25DF57530B78}.Release|Any CPU.Build.0 = Release|Any CPU
{CDB3F17C-D096-4BEB-94D8-BFDB3E1888F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CDB3F17C-D096-4BEB-94D8-BFDB3E1888F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDB3F17C-D096-4BEB-94D8-BFDB3E1888F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CDB3F17C-D096-4BEB-94D8-BFDB3E1888F8}.Release|Any CPU.Build.0 = Release|Any CPU
{360608A1-942E-4751-B878-E5239BF0595D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{360608A1-942E-4751-B878-E5239BF0595D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{360608A1-942E-4751-B878-E5239BF0595D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{360608A1-942E-4751-B878-E5239BF0595D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
8 changes: 8 additions & 0 deletions WorkplaceStrategy/SpaceMetrics/dependencies/SpaceBoundary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Elements.Geometry;
namespace Elements
{
public partial class SpaceBoundary
{
public Vector3? ParentCentroid { get; set; }
}
}
107 changes: 107 additions & 0 deletions WorkplaceStrategy/SpaceMetrics/dependencies/SpaceBoundary.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
//----------------------
// <auto-generated>
// Generated using the NJsonSchema v10.1.21.0 (Newtonsoft.Json v13.0.0.0) (http://NJsonSchema.org)
// </auto-generated>
//----------------------
using Elements;
using Elements.GeoJSON;
using Elements.Geometry;
using Elements.Geometry.Solids;
using Elements.Spatial;
using Elements.Validators;
using Elements.Serialization.JSON;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using Line = Elements.Geometry.Line;
using Polygon = Elements.Geometry.Polygon;

namespace Elements
{
#pragma warning disable // Disable all warnings

/// <summary>A profile with a program assigned to it, and optional internal cell geometry. </summary>
[JsonConverter(typeof(Elements.Serialization.JSON.JsonInheritanceConverter), "discriminator")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]
public partial class SpaceBoundary : GeometricElement
{
[JsonConstructor]
public SpaceBoundary(Profile @boundary, IList<Polygon> @cells, double @area, double? @length, double? @depth, double @height, string @programGroup, string @programType, System.Guid? @programRequirement, System.Guid? @level, System.Guid? @levelLayout, string @hyparSpaceType, string @defaultWallType, Transform @transform = null, Material @material = null, Representation @representation = null, bool @isElementDefinition = false, System.Guid @id = default, string @name = null)
: base(transform, material, representation, isElementDefinition, id, name)
{
this.Boundary = @boundary;
this.Cells = @cells;
this.Area = @area;
this.Length = @length;
this.Depth = @depth;
this.Height = @height;
this.ProgramGroup = @programGroup;
this.ProgramType = @programType;
this.ProgramRequirement = @programRequirement;
this.Level = @level;
this.LevelLayout = @levelLayout;
this.HyparSpaceType = @hyparSpaceType;
this.DefaultWallType = @defaultWallType;
}


// Empty constructor
public SpaceBoundary()
: base()
{
}

/// <summary>The boundary of the space</summary>
[JsonProperty("Boundary", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public Profile Boundary { get; set; }

/// <summary>Component cells making up the boundary</summary>
[JsonProperty("Cells", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public IList<Polygon> Cells { get; set; }

/// <summary>The area of the boundary</summary>
[JsonProperty("Area", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double Area { get; set; }

/// <summary>The rough length of this space boundary, parallel to the accessible edge</summary>
[JsonProperty("Length", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double? Length { get; set; }

/// <summary>The rough depth of the space boundary, perpendicular to the accessible edge</summary>
[JsonProperty("Depth", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double? Depth { get; set; }

/// <summary>The height of this space boundary</summary>
[JsonProperty("Height", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double Height { get; set; }

/// <summary>A program grouping, like a department.</summary>
[JsonProperty("Program Group", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string ProgramGroup { get; set; }

/// <summary>The name of the program type assigned to this space (like "Open Office" or "Meeting Room")</summary>
[JsonProperty("Program Type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string ProgramType { get; set; }

[JsonProperty("Program Requirement", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? ProgramRequirement { get; set; }

[JsonProperty("Level", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? Level { get; set; }

/// <summary>The layout, if any, which generated this space boundary.</summary>
[JsonProperty("Level Layout", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? LevelLayout { get; set; }

/// <summary>The hypar-recognized space type name which will be used to determine which layout function to apply. In older space boundaries, this may not be set — fall back to the Name property for this purpose if not provided.</summary>
[JsonProperty("Hypar Space Type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string HyparSpaceType { get; set; }

/// <summary>What wall type should generally be created for this space type? This may get overridden later on for a specific wall.</summary>
[JsonProperty("Default Wall Type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string DefaultWallType { get; set; }


}
}
69 changes: 69 additions & 0 deletions WorkplaceStrategy/SpaceMetrics/dependencies/SpaceMetric.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//----------------------
// <auto-generated>
// Generated using the NJsonSchema v10.1.21.0 (Newtonsoft.Json v13.0.0.0) (http://NJsonSchema.org)
// </auto-generated>
//----------------------
using Elements;
using Elements.GeoJSON;
using Elements.Geometry;
using Elements.Geometry.Solids;
using Elements.Spatial;
using Elements.Validators;
using Elements.Serialization.JSON;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using Line = Elements.Geometry.Line;
using Polygon = Elements.Geometry.Polygon;

namespace Elements
{
#pragma warning disable // Disable all warnings

/// <summary>Attach these to spaces to include information useful for metrics and calculations</summary>
[JsonConverter(typeof(Elements.Serialization.JSON.JsonInheritanceConverter), "discriminator")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]
public partial class SpaceMetric : Element
{
[JsonConstructor]
public SpaceMetric(System.Guid? @space, double @seats, double @headcount, double @desks, double @collaborationSeats, System.Guid @id = default, string @name = null)
: base(id, name)
{
this.Space = @space;
this.Seats = @seats;
this.Headcount = @headcount;
this.Desks = @desks;
this.CollaborationSeats = @collaborationSeats;
}


// Empty constructor
public SpaceMetric()
: base()
{
}

/// <summary>The space we are attaching metrics to</summary>
[JsonProperty("Space", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Guid? Space { get; set; }

/// <summary>Seat count for this space.</summary>
[JsonProperty("Seats", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double Seats { get; set; }

/// <summary>Headcount for this space.</summary>
[JsonProperty("Headcount", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double Headcount { get; set; }

/// <summary>Desks for this space.</summary>
[JsonProperty("Desks", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double Desks { get; set; }

/// <summary>Seats for collaboration in this space.</summary>
[JsonProperty("Collaboration Seats", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public double CollaborationSeats { get; set; }


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.1.0" />
<PackageReference Include="Hypar.Functions" Version="1.10.0" />
</ItemGroup>

</Project>
Loading
Loading