| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using System;
- using Autodesk.Revit.UI;
- using DrawData;
- using SAGA.GplotDrawData;
- using SAGA.GplotRelationComputerManage;
- using SAGA.Models;
- using SAGA.RevitUtils.Extends;
- using SAGA.RevitUtils.Windows;
- namespace SAGA.GplotManage.UploadRelated
- {
- public abstract class SpaceRelated : Gplot
- {
- protected SpaceRelated()
- {
- IsSpace = true;
- }
- }
- public class ElementSpNeighborhood : SpaceRelated
- {
- public override GraphTypeEnum GraphType => GraphTypeEnum.ElementSpNeighborhood;
- public override Type DataType => typeof(SpaceData);
- public override void Computer()
- {
- ReadSpaceCommand cmd = new ReadSpaceCommand();
- cmd.Computer();
- // DrawDataServer.SaveAsFile(new SpaceData());
- }
- [CheckAndKeepGplotLaster]
- public override void Show(GplotShowType showType)
- {
- var win = new WinDrawSpace_Web(showType);//
- win.ComputerAction += () => ExecuteCmd.ExecuteCommand(() =>
- {
- Computer();
- return Result.Succeeded;
- });
- win.Show();
-
-
- }
- [CheckAndKeepGplotLaster]
- protected override void DealUploadData()
- {
- var spaces = DrawDataServer.GetSpaceData(SpaceRelatedEnum.Adjacent);
- foreach (var spacesFloorData in spaces.FloorDatas)
- {
- foreach (var space in spacesFloorData.EndPoints)
- {
- space.AdjacentSpaces.AddRange(space.UpElements);
- foreach (var adjacentSpace in space.AdjacentSpaces)
- {
- var rdata = GetReleateData(space.Id, adjacentSpace.Space.Id, ((int)GetRelationType(adjacentSpace.RelatedEnum)) + "");
- this.Criterias.criterias.Add(rdata);
- }
- }
- }
- }
- SpaceRelationType GetRelationType(SpaceRelatedEnum sre)
- {
- switch (sre)
- {
- case SpaceRelatedEnum.Adjacent:
- return SpaceRelationType.Throught;//虚拟墙
- case SpaceRelatedEnum.Radiation | SpaceRelatedEnum.Ventilation:
- return SpaceRelationType.Window;//窗
- case SpaceRelatedEnum.Crossing | SpaceRelatedEnum.Ventilation:
- return SpaceRelationType.Door;
- default: return SpaceRelationType.None;
- }
- }
- enum SpaceRelationType
- {
- None = 1,
- Door = 2,
- Window = 3,
- DoorAndWindow = 4,
- Throught = 5//连同
- }
- }
- }
|