Skip to content

Aligning with Grid and Level migration to Spatial #305

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

Merged
merged 2 commits into from
Jan 14, 2022
Merged
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
18 changes: 9 additions & 9 deletions TAS_Engine/Convert/Architecture/Level.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
using System.Text;
using System.Threading.Tasks;

using BHA = BH.oM.Architecture.Elements;
using BHS = BH.oM.Spatial.SettingOut;
using BHE = BH.oM.Environment.Elements;
using BHG = BH.oM.Geometry;
using BH.Engine.Geometry;
Expand All @@ -41,9 +41,9 @@ public static partial class Convert
[Description("Gets a list of BHoM Architectural Levels from a TAS TBD Building")]
[Input("tbdBuilding", "TAS TBD Building")]
[Output("BHoM Architectural Levels")]
public static List<BHA.Level> FromTASLevels(this TBD.Building tbdBuilding)
public static List<BHS.Level> FromTASLevels(this TBD.Building tbdBuilding)
{
List<BHA.Level> levels = new List<BHA.Level>();
List<BHS.Level> levels = new List<BHS.Level>();

int storeyIndex = 0;
TBD.BuildingStorey storey = null;
Expand All @@ -59,9 +59,9 @@ public static partial class Convert
[Description("Gets a BHoM Architectural Level from a TAS TBD Building Storey")]
[Input("tbdStorey", "TAS TBD Building Storey")]
[Output("BHoM Architectural Level")]
public static BHA.Level FromTAS(this TBD.BuildingStorey tbdStorey)
public static BHS.Level FromTAS(this TBD.BuildingStorey tbdStorey)
{
BHA.Level level = new BHA.Level();
BHS.Level level = new BHS.Level();

if (tbdStorey.GetPerimeter(0) != null)
{
Expand All @@ -77,9 +77,9 @@ public static BHA.Level FromTAS(this TBD.BuildingStorey tbdStorey)
[Description("Gets a BHoM Architectural Level from a TAS T3D Floor")]
[Input("tbdFloor", "TAS T3D Floor")]
[Output("BHoM Architectural Level")]
public static BHA.Level FromTAS(this TAS3D.Floor tbdFloor)
public static BHS.Level FromTAS(this TAS3D.Floor tbdFloor)
{
BHA.Level level = new BHA.Level();
BHS.Level level = new BHS.Level();

level.Name = tbdFloor.name;
level.Elevation = tbdFloor.level.Round();
Expand All @@ -90,7 +90,7 @@ public static BHA.Level FromTAS(this TAS3D.Floor tbdFloor)
[Description("BH.Engine.Adapters.TAS.Convert ToTAS => gets a TAS TBD Building from a list of BHoM Architecture Levels")]
[Input("levels","BHoM Architectural Levels")]
[Output("TAS TBD Building")]
public static TBD.BuildingStoreyClass ToTAS(this List<BHA.Level> levels)
public static TBD.BuildingStoreyClass ToTAS(this List<BHS.Level> levels)
{
TBD.BuildingStoreyClass tbdLevels = new TBD.BuildingStoreyClass();
if (levels == null) return tbdLevels;
Expand All @@ -101,7 +101,7 @@ public static TBD.BuildingStoreyClass ToTAS(this List<BHA.Level> levels)
[Description("Gets a TAS TBD Building Storey from a BHoM Architecture Level")]
[Input("level", "BHoM Architecture Level")]
[Output("TAS TBD Building Storey")]
public static TBD.BuildingStoreyClass ToTAS(this BHA.Level level)
public static TBD.BuildingStoreyClass ToTAS(this BHS.Level level)
{
TBD.BuildingStoreyClass tbdLevel = new TBD.BuildingStoreyClass();
if (level == null) return tbdLevel;
Expand Down
5 changes: 5 additions & 0 deletions TAS_Engine/TAS_Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Spatial_oM">
<HintPath>C:\ProgramData\BHoM\Assemblies\Spatial_oM.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
Expand Down
6 changes: 3 additions & 3 deletions TAS_TBDAdapter/CRUD/Read.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected override IEnumerable<IBHoMObject> IRead(Type type, IList indices = nul
// return ReadElementsProperties();
else if (type == typeof(Layer))
return ReadMaterials();
else if (type == typeof(BH.oM.Architecture.Elements.Level))
else if (type == typeof(BH.oM.Spatial.SettingOut.Level))
return ReadLevels();
else if (type == typeof(Construction))
return ReadConstruction();
Expand Down Expand Up @@ -121,10 +121,10 @@ private List<Building> ReadBuilding(List<string> ids = null)

/***************************************************/

private List<BH.oM.Architecture.Elements.Level> ReadLevels(List<string> ids = null)
private List<BH.oM.Spatial.SettingOut.Level> ReadLevels(List<string> ids = null)
{
TBD.Building tbdBuilding = m_tbdDocument.Building;
List<BH.oM.Architecture.Elements.Level> levels = new List<BH.oM.Architecture.Elements.Level>();
List<BH.oM.Spatial.SettingOut.Level> levels = new List<BH.oM.Spatial.SettingOut.Level>();
levels = BH.Engine.Adapters.TAS.Convert.FromTASLevels(tbdBuilding);

return levels;
Expand Down
5 changes: 5 additions & 0 deletions TAS_TBDAdapter/TAS_TBDAdapter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Spatial_oM">
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
<HintPath>C:\ProgramData\BHoM\Assemblies\Spatial_oM.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand Down