77 lines
2.2 KiB
C#
77 lines
2.2 KiB
C#
|
|
using System.Linq;
|
|
|
|
using Autodesk.Revit.DB;
|
|
|
|
using EPPlus.Core.Extensions.Attributes;
|
|
|
|
namespace Szmedi.RvKits.InfoManager.EAMTools
|
|
{
|
|
public class InstanceFacility : ObservableObject, IFacility
|
|
{
|
|
private bool? isMapped = false;
|
|
[ExcelTableColumn("是否匹配", true)]
|
|
public bool? IsMapped
|
|
{
|
|
get => isMapped;
|
|
set => SetProperty(ref isMapped, value);
|
|
}
|
|
|
|
private string eamCode;
|
|
public InstanceFacility(FamilyInstance instance)
|
|
{
|
|
Instance = instance;
|
|
}
|
|
|
|
public FamilyInstance Instance { get; set; }
|
|
[ExcelTableColumn("类别名称")]
|
|
public string CategoryName => Instance.Category.Name;
|
|
|
|
[ExcelTableColumn("族名称")]
|
|
public string FamilyName => Instance.Symbol.FamilyName;
|
|
|
|
[ExcelTableColumn("实例名称")]
|
|
public string Name => Instance.Name;
|
|
|
|
[ExcelTableColumn("元素ID")]
|
|
public ElementId Id => Instance.Id;
|
|
|
|
[ExcelTableColumn("标高")]
|
|
public string LevelName => Instance.GetLevelId() == ElementId.InvalidElementId ? string.Empty : Instance.Document.GetElement(Instance.LevelId).Name;
|
|
|
|
[ExcelTableColumn("偏移")]
|
|
public string Offset => Instance.get_Parameter(BuiltInParameter.INSTANCE_FREE_HOST_OFFSET_PARAM).AsValueString();
|
|
[ExcelTableColumn("所属楼层")]
|
|
public string Floor => Instance.GetParameters("所属楼层").FirstOrDefault()?.AsString();
|
|
|
|
private string number;
|
|
[ExcelTableColumn("标记")]
|
|
public string Number
|
|
{
|
|
get
|
|
{
|
|
return number;
|
|
}
|
|
set
|
|
{
|
|
value = Instance.get_Parameter(BuiltInParameter.DOOR_NUMBER)?.AsString();
|
|
SetProperty(ref number, value);
|
|
}
|
|
}
|
|
|
|
[ExcelTableColumn("EAM编码")]
|
|
public string EAMCode
|
|
{
|
|
get => eamCode;
|
|
set => SetProperty(ref eamCode, value);
|
|
}
|
|
|
|
private string mapErrorMessage;
|
|
[ExcelTableColumn("匹配错误")]
|
|
public string MapErrorMessage
|
|
{
|
|
get => mapErrorMessage; set => SetProperty(ref mapErrorMessage, value);
|
|
}
|
|
}
|
|
}
|