Shuxia Ning
2025-01-17 a0bce3b366451b3ca94e676eb98dd7b415375c14
Service/HStation.Service.Revit.Core/02-parter/00-core/RevitParter.cs
@@ -16,8 +16,8 @@
        public RevitParter(Model.RevitParter rhs)
        {
            this.Id = rhs.Id;
            this.Catalog = rhs.Catalog;
            this.Name = rhs.Name;
            this.Code = rhs.Code;
            this.ModelType = rhs.ModelType;
            this.Flags = rhs.Flags;
            this.Description = rhs.Description;
@@ -32,14 +32,14 @@
        public string Id { get; set; }
        /// <summary>
        /// 分类
        /// </summary>
        public string Catalog { get; set; }
        /// <summary>
        /// 名称
        /// </summary>   
        public string Name { get; set; }
        /// <summary>
        /// 编码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 型号
@@ -66,6 +66,43 @@
        /// </summary>
        public List<RevitPropStatus> PropStatusList { get; set; }
        /// <summary>
        /// 获取属性名称
        /// </summary>
        public RevitPropStatus GetPropStatus(string propName)
        {
            if (string.IsNullOrEmpty(propName))
            {
                return default;
            }
            var propStatus = this.PropStatusList?.Find(x => x.PropName == propName);
            return propStatus;
        }
        /// <summary>
        /// 更新属性状态
        /// </summary>
        public bool UpdatePropStatus(string propName, ePropStatus propStatus, string statusInfo)
        {
            if (string.IsNullOrEmpty(propName))
            {
                return false;
            }
            if (this.PropStatusList == null)
            {
                this.PropStatusList = new List<Model.RevitPropStatus>();
            }
            var propStatusModel = this.GetPropStatus(propName);
            if (propStatusModel == null)
            {
                propStatusModel = new Model.RevitPropStatus() { PropName = propName };
                this.PropStatusList.Add(propStatusModel);
            }
            propStatusModel.PropStatus = propStatus;
            propStatusModel.StatusInfo = statusInfo;
            return true;
        }
    }
}