/
tschai08
/
ModelRaschetIfc
Обзор
Документация
Войти
/
tschai08
/
ModelRaschetIfc
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
IfcLibrary/PropertyCreatReadIfc.cs
533 строки
25 KB
EU\sis6
Первый коммит модели ifc
11 июн 2026, 14:35
11 июн 2026, 14:35
ce2ae98
Код
Авторство
О чём код?
using DateWL; using System; using Xbim.Ifc; using Xbim.Ifc4.DateTimeResource; using Xbim.Ifc4.Kernel; using Xbim.Ifc4.MeasureResource; using Xbim.Ifc4.PropertyResource; namespace IfcLibrary { //#endregion public class PropertyCreatReadIfc { public const string ApplicableOccurrenceOpor = "IfcBuildingElementProxy"; public const string ApplicableOccurrenceProwod = "IfcCableSegment"; public const string ApplicableOccurrenceGirlind = "IfcGirljnd"; protected IfcStore _ifcModel; public PropertyCreatReadIfc(IfcStore IfcModel) { _ifcModel = IfcModel; } #region Create PropertySet public void AddProperty(IfcPropertySet pSet, string name, IfcValue value) { var property = _ifcModel.Instances.New<IfcPropertySingleValue>(); property.Name = name; property.NominalValue = value; pSet.HasProperties.Add(property); } /// <summary> /// Добавление строкового свойства /// </summary> public void AddStringProperty(IfcPropertySet pSet, string name, string value) { var prop = _ifcModel.Instances.New<IfcPropertySingleValue>(); prop.Name = name; prop.NominalValue = new IfcLabel(value); pSet.HasProperties.Add(prop); } /// <summary> /// Добавление числового свойства (длина) /// </summary> public void AddLengthProperty(IfcPropertySet pSet, string name, double value) { var prop = _ifcModel.Instances.New<IfcPropertySingleValue>(); prop.Name = name; prop.NominalValue = new IfcLengthMeasure(value); pSet.HasProperties.Add(prop); } /// <summary> /// Добавление целочисленного свойства /// </summary> public void AddIntegerProperty(IfcPropertySet pSet, string name, int value) { var prop = _ifcModel.Instances.New<IfcPropertySingleValue>(); prop.Name = name; prop.NominalValue = new IfcInteger(value); pSet.HasProperties.Add(prop); } #region CreateProperty /// <summary> /// Создание набора свойств для работы/проекта /// </summary> public IfcPropertySet CreateAWl_RabotPropertySet(AWl_Rabot work) { var pSet = _ifcModel.Instances.New<IfcPropertySet>(); pSet.Name = $"{AWl_RabotPropertyNames.KorenPset}{work.NameRab ?? work.UidRab.ToString().Substring(0, 8)}"; pSet.Description = "Параметры проекта/работы"; // Идентификаторы AddProperty(pSet, AWl_RabotPropertyNames.UidRab, new IfcLabel(work.UidRab.ToString())); AddProperty(pSet, AWl_RabotPropertyNames.NameRab, new IfcText(work.NameRab ?? "")); AddProperty(pSet, AWl_RabotPropertyNames.Id_WL, new IfcInteger(work.Id_WL)); AddProperty(pSet, AWl_RabotPropertyNames.Id_Contract, new IfcInteger(work.Id_Contract)); // Параметры ВЛ AddProperty(pSet, AWl_RabotPropertyNames.Unom, new IfcInteger(work.Unom)); if (!string.IsNullOrEmpty(work.NameWL_ps)) AddProperty(pSet, AWl_RabotPropertyNames.NameWL_ps, new IfcLabel(work.NameWL_ps)); if (!string.IsNullOrEmpty(work.OpisRab)) AddProperty(pSet, AWl_RabotPropertyNames.OpisRab, new IfcText(work.OpisRab)); // Служебные поля if (work.DataI.HasValue) AddProperty(pSet, AWl_RabotPropertyNames.DataI, new IfcDateTime(work.DataI.Value.ToString("yyyy-MM-ddTHH:mm:ss"))); if (!string.IsNullOrEmpty(work.Polz)) AddProperty(pSet, AWl_RabotPropertyNames.Polz, new IfcLabel(work.Polz)); return pSet; } /// <summary> /// Создание набора свойств для участка трассы /// </summary> public IfcPropertySet CreateAuchastkiNsPropertySet(AuchastkiNs uchastok) { var pSet = _ifcModel.Instances.New<IfcPropertySet>(); pSet.Name = $"{AuchastkiNsPropertyNames.KorenPset}{uchastok.NameUch ?? uchastok.UidUch.ToString().Substring(0, 8)}"; pSet.Description = "Параметры участка трассы"; // Идентификаторы AddProperty(pSet, AuchastkiNsPropertyNames.UidUch, new IfcLabel(uchastok.UidUch.ToString())); AddProperty(pSet, AuchastkiNsPropertyNames.UidRab, new IfcLabel(uchastok.UidRab.ToString())); AddProperty(pSet, AuchastkiNsPropertyNames.NameUch, new IfcText(uchastok.NameUch)); // Параметры участка AddProperty(pSet, AuchastkiNsPropertyNames.Shirina, new IfcLengthMeasure(uchastok.Shirina)); if (!string.IsNullOrEmpty(uchastok.Comment)) AddProperty(pSet, AuchastkiNsPropertyNames.Comment, new IfcText(uchastok.Comment)); AddProperty(pSet, AuchastkiNsPropertyNames.Npor, new IfcInteger(uchastok.Npor)); if (!string.IsNullOrEmpty(uchastok.Descriptor)) AddProperty(pSet, AuchastkiNsPropertyNames.Descriptor, new IfcText(uchastok.Descriptor)); return pSet; } /// <summary> /// Создание набора свойств для климатических условий пикета /// </summary> public IfcPropertySet CreateTizKlimatsPropertySet(TizKlimats klimat) { var pSet = _ifcModel.Instances.New<IfcPropertySet>(); pSet.Name = $"{TizKlimatsPropertyNames.KorenPset}{klimat.UidTchk.ToString().Substring(0, 8)}"; pSet.Description = "Климатические условия пикета"; // Идентификаторы AddProperty(pSet, TizKlimatsPropertyNames.UidTchk, new IfcLabel(klimat.UidTchk.ToString())); AddProperty(pSet, TizKlimatsPropertyNames.TizPikets_UidTchk, new IfcLabel(klimat.TizPikets_UidTchk.ToString())); // Климатические параметры if (klimat.StGolEkw.HasValue) AddProperty(pSet, TizKlimatsPropertyNames.StGolEkw, new IfcInteger(klimat.StGolEkw.Value)); if (klimat.StGolUsl.HasValue) AddProperty(pSet, TizKlimatsPropertyNames.StGolUsl, new IfcInteger(klimat.StGolUsl.Value)); if (klimat.Texsp.HasValue) AddProperty(pSet, TizKlimatsPropertyNames.Texsp, new IfcInteger(klimat.Texsp.Value)); if (klimat.Tgol.HasValue) AddProperty(pSet, TizKlimatsPropertyNames.Tgol, new IfcInteger(klimat.Tgol.Value)); if (klimat.Tmin.HasValue) AddProperty(pSet, TizKlimatsPropertyNames.Tmin, new IfcInteger(klimat.Tmin.Value)); if (klimat.Tmax.HasValue) AddProperty(pSet, TizKlimatsPropertyNames.Tmax, new IfcInteger(klimat.Tmax.Value)); // Ветровые параметры if (klimat.NaporVetra.HasValue) AddProperty(pSet, TizKlimatsPropertyNames.NaporVetra, new IfcReal(klimat.NaporVetra.Value)); if (klimat.NapPriGol.HasValue) AddProperty(pSet, TizKlimatsPropertyNames.NapPriGol, new IfcReal(klimat.NapPriGol.Value)); if (klimat.TipMesta.HasValue) AddProperty(pSet, TizKlimatsPropertyNames.TipMesta, new IfcInteger(klimat.TipMesta.Value)); return pSet; } /// <summary> /// Создание набора свойств для особенностей пикета /// </summary> public IfcPropertySet CreateTizOsobPropertySet(TizOsob osob) { var pSet = _ifcModel.Instances.New<IfcPropertySet>(); pSet.Name = $"{TizOsobPropertyNames.KorenPset}{osob.UidTchk.ToString().Substring(0, 8)}"; pSet.Description = "Особенности пикета"; // Идентификаторы AddProperty(pSet, TizOsobPropertyNames.UidTchk, new IfcLabel(osob.UidTchk.ToString())); AddProperty(pSet, TizOsobPropertyNames.NameUch_Piketaj, new IfcLabel(osob.TizPikets?.AuchastkiNs.NameUch + "_" + osob.TizPikets?.Piketaj.ToString("f1") ?? "")); // Параметры особенностей AddProperty(pSet, TizOsobPropertyNames.IdTipSoor, new IfcInteger(osob.IdTipSoor)); if (osob.Param1.HasValue) AddProperty(pSet, TizOsobPropertyNames.Param1, new IfcLengthMeasure(osob.Param1.Value)); if (osob.Param2.HasValue) AddProperty(pSet, TizOsobPropertyNames.Param2, new IfcLengthMeasure(osob.Param2.Value)); if (osob.Param3.HasValue) AddProperty(pSet, TizOsobPropertyNames.Param3, new IfcLengthMeasure(osob.Param3.Value)); if (osob.Param4.HasValue) AddProperty(pSet, TizOsobPropertyNames.Param4, new IfcLengthMeasure(osob.Param4.Value)); if (!string.IsNullOrEmpty(osob.Opis)) AddProperty(pSet, TizOsobPropertyNames.Opis, new IfcText(osob.Opis)); if (!string.IsNullOrEmpty(osob.HorizontDan)) AddProperty(pSet, TizOsobPropertyNames.HorizontDan, new IfcText(osob.HorizontDan)); return pSet; } /// <summary> /// Создание набора свойств для угодий пикета /// </summary> public IfcPropertySet CreateTizPikUgodsPropertySet(TizPikUgods ugods) { var pSet = _ifcModel.Instances.New<IfcPropertySet>(); pSet.Name = $"{TizPikUgodsPropertyNames.KorenPset}{ugods.UidTchk.ToString().Substring(0, 8)}"; pSet.Description = "Угодья пикета"; // Идентификаторы AddProperty(pSet, TizPikUgodsPropertyNames.UidTchk, new IfcLabel(ugods.UidTchk.ToString())); // Параметры угодий if (ugods.Tip.HasValue) AddProperty(pSet, TizPikUgodsPropertyNames.Tip, new IfcInteger(ugods.Tip.Value)); if (!string.IsNullOrEmpty(ugods.Dann)) AddProperty(pSet, TizPikUgodsPropertyNames.Dann, new IfcText(ugods.Dann)); return pSet; } #endregion /// <summary> /// Создание набора свойств для параметров участка /// </summary> public IfcPropertySet CreateEwParamUchPropertySet(EwParamUch paramUch) { var pSet = _ifcModel.Instances.New<IfcPropertySet>(); pSet.Name = $"{EwParamUchPropertyNames.KorenPset}{paramUch.UidUch.ToString().Substring(0, 8)}"; pSet.Description = "Параметры участка (расчетные)"; // Идентификатор AddProperty(pSet, EwParamUchPropertyNames.UidUch, new IfcLabel(paramUch.UidUch.ToString())); // Габариты if (paramUch.Gnw.HasValue) AddProperty(pSet, EwParamUchPropertyNames.Gnw, new IfcLengthMeasure(paramUch.Gnw.Value)); if (paramUch.GnwG.HasValue) AddProperty(pSet, EwParamUchPropertyNames.GnwG, new IfcLengthMeasure(paramUch.GnwG.Value)); if (paramUch.Greg.HasValue) AddProperty(pSet, EwParamUchPropertyNames.Greg, new IfcLengthMeasure(paramUch.Greg.Value)); if (paramUch.GregGol.HasValue) AddProperty(pSet, EwParamUchPropertyNames.GregGol, new IfcLengthMeasure(paramUch.GregGol.Value)); // Ссылки на опоры if (paramUch.UidOporA.HasValue) AddProperty(pSet, EwParamUchPropertyNames.UidOporA, new IfcLabel(paramUch.UidOporA.Value.ToString())); if (paramUch.UidOporP.HasValue) AddProperty(pSet, EwParamUchPropertyNames.UidOporP, new IfcLabel(paramUch.UidOporP.Value.ToString())); // Ссылки на гирлянды if (paramUch.UidGirlRab.HasValue) AddProperty(pSet, EwParamUchPropertyNames.UidGirlRab, new IfcLabel(paramUch.UidGirlRab.Value.ToString())); if (paramUch.UidGirlRabT.HasValue) AddProperty(pSet, EwParamUchPropertyNames.UidGirlRabT, new IfcLabel(paramUch.UidGirlRabT.Value.ToString())); if (paramUch.UidGirlRabW.HasValue) AddProperty(pSet, EwParamUchPropertyNames.UidGirlRabW, new IfcLabel(paramUch.UidGirlRabW.Value.ToString())); // Ссылки на провода if (paramUch.UidProwRab.HasValue) AddProperty(pSet, EwParamUchPropertyNames.UidProwRab, new IfcLabel(paramUch.UidProwRab.Value.ToString())); if (paramUch.UidProwRabT.HasValue) AddProperty(pSet, EwParamUchPropertyNames.UidProwRabT, new IfcLabel(paramUch.UidProwRabT.Value.ToString())); if (paramUch.UidProwRabW.HasValue) AddProperty(pSet, EwParamUchPropertyNames.UidProwRabW, new IfcLabel(paramUch.UidProwRabW.Value.ToString())); // Служебные поля if (paramUch.DataI.HasValue) AddProperty(pSet, EwParamUchPropertyNames.DataI, new IfcDateTime(paramUch.DataI.Value.ToString("yyyy-MM-ddTHH:mm:ss"))); if (!string.IsNullOrEmpty(paramUch.Polz)) AddProperty(pSet, EwParamUchPropertyNames.Polz, new IfcLabel(paramUch.Polz)); return pSet; } public IfcPropertySet CreateEwRastOpPropertySet(EwRastOp opora) { var pSet = _ifcModel.Instances.New<IfcPropertySet>(); pSet.Name = $"{EwRastOpPropertyNames.KorenPset}{opora.NumName ?? opora.UidOpor.ToString().Substring(0, 8)}"; // Идентификаторы AddProperty(pSet, EwRastOpPropertyNames.UidOpor, new IfcLabel(opora.UidOpor.ToString())); AddProperty(pSet, EwRastOpPropertyNames.UidUch, new IfcLabel(opora.UidUch.ToString())); AddProperty(pSet, EwRastOpPropertyNames.NumName, new IfcText(opora.NumName)); // Геометрические параметры AddProperty(pSet, EwRastOpPropertyNames.Piketaj, new IfcLengthMeasure(opora.Piketaj)); if (opora.Wisota.HasValue) AddProperty(pSet, EwRastOpPropertyNames.Wisota, new IfcLengthMeasure(opora.Wisota.Value)); AddProperty(pSet, EwRastOpPropertyNames.Tip, new IfcInteger(opora.Tip)); if (opora.PodwesW.HasValue) AddProperty(pSet, EwRastOpPropertyNames.PodwesW, new IfcLengthMeasure(opora.PodwesW.Value)); if (opora.WinosOksn.HasValue) AddProperty(pSet, EwRastOpPropertyNames.WinosOksn, new IfcLengthMeasure(opora.WinosOksn.Value)); if (!string.IsNullOrEmpty(opora.UgolPoworot)) AddProperty(pSet, EwRastOpPropertyNames.UgolPoworot, new IfcLabel(opora.UgolPoworot)); // Ссылки на справочники if (opora.UidOpRab.HasValue) AddProperty(pSet, EwRastOpPropertyNames.UidOpRab, new IfcLabel(opora.UidOpRab.Value.ToString())); if (opora.UidGirlRab.HasValue) AddProperty(pSet, EwRastOpPropertyNames.UidGirlRab, new IfcLabel(opora.UidGirlRab.Value.ToString())); if (opora.UidGirlRabT.HasValue) AddProperty(pSet, EwRastOpPropertyNames.UidGirlRabT, new IfcLabel(opora.UidGirlRabT.Value.ToString())); if (opora.UidGirlRabW.HasValue) AddProperty(pSet, EwRastOpPropertyNames.UidGirlRabW, new IfcLabel(opora.UidGirlRabW.Value.ToString())); // Служебные поля if (opora.DataI.HasValue) AddProperty(pSet, EwRastOpPropertyNames.DataI, new IfcDateTime(opora.DataI.Value.ToString("yyyy-MM-ddTHH:mm:ss"))); if (!string.IsNullOrEmpty(opora.Polz)) AddProperty(pSet, EwRastOpPropertyNames.Polz, new IfcLabel(opora.Polz)); return pSet; } public IfcPropertySet CreateEwMechUslPropertySet(EwMechUsl mech) { var pSet = _ifcModel.Instances.New<IfcPropertySet>(); pSet.Name = $"{EwMechUslPropertyNames.KorenPset}{mech.UidOpor.ToString().Substring(0, 8)}"; // Напряжения if (mech.Sig1_Tmin.HasValue) AddProperty(pSet, EwMechUslPropertyNames.Sig1_Tmin, new IfcReal(mech.Sig1_Tmin.Value)); if (mech.Sig1_Texsp.HasValue) AddProperty(pSet, EwMechUslPropertyNames.Sig1_Texsp, new IfcReal(mech.Sig1_Texsp.Value)); if (mech.Sig7_Tgol.HasValue) AddProperty(pSet, EwMechUslPropertyNames.Sig7_Tgol, new IfcReal(mech.Sig7_Tgol.Value)); if (mech.Sig1_TexspT.HasValue) AddProperty(pSet, EwMechUslPropertyNames.Sig1_TexspT, new IfcReal(mech.Sig1_TexspT.Value)); if (mech.Sig7_TgolT.HasValue) AddProperty(pSet, EwMechUslPropertyNames.Sig7_TgolT, new IfcReal(mech.Sig7_TgolT.Value)); if (mech.Sig1_TexspW.HasValue) AddProperty(pSet, EwMechUslPropertyNames.Sig1_TexspW, new IfcReal(mech.Sig1_TexspW.Value)); if (mech.Sig7_TgolW.HasValue) AddProperty(pSet, EwMechUslPropertyNames.Sig7_TgolW, new IfcReal(mech.Sig7_TgolW.Value)); // Параметры if (mech.ProwodFaz.HasValue) AddProperty(pSet, EwMechUslPropertyNames.ProwodFaz, new IfcInteger(mech.ProwodFaz.Value)); if (mech.Gabarit.HasValue) AddProperty(pSet, EwMechUslPropertyNames.Gabarit, new IfcLengthMeasure(mech.Gabarit.Value)); // Ссылки if (mech.UidOpRab.HasValue) AddProperty(pSet, EwMechUslPropertyNames.UidOpRab, new IfcLabel(mech.UidOpRab.Value.ToString())); if (mech.UidGirlRab.HasValue) AddProperty(pSet, EwMechUslPropertyNames.UidGirlRab, new IfcLabel(mech.UidGirlRab.Value.ToString())); if (mech.UidProwRab.HasValue) AddProperty(pSet, EwMechUslPropertyNames.UidProwRab, new IfcLabel(mech.UidProwRab.Value.ToString())); // Служебные поля if (!string.IsNullOrEmpty(mech.Polz)) AddProperty(pSet, EwMechUslPropertyNames.Polz, new IfcLabel(mech.Polz)); return pSet; } public IfcPropertySet CreateTypePropertySet(EwOporRab typeInfo) { var pSet = _ifcModel.Instances.New<IfcPropertySet>(); pSet.Name = $"{EwOporRabPropertyNames.KorenPset}{typeInfo.ShifrOp}"; AddProperty(pSet, EwOporRabPropertyNames.ShifrOp, new IfcText(typeInfo.ShifrOp)); // Основные параметры AddProperty(pSet, EwOporRabPropertyNames.Wis_op, new IfcLengthMeasure(typeInfo.Wis_op)); AddProperty(pSet, EwOporRabPropertyNames.Wis_opT, new IfcLengthMeasure(typeInfo.Wis_opT)); if (typeInfo.Wis_op1.HasValue) AddProperty(pSet, EwOporRabPropertyNames.Wis_op1, new IfcLengthMeasure(typeInfo.Wis_op1.Value)); if (typeInfo.Wis_op2.HasValue) AddProperty(pSet, EwOporRabPropertyNames.Wis_op2, new IfcLengthMeasure(typeInfo.Wis_op2.Value)); // Длины траверс if (typeInfo.DlinaTravers.HasValue) AddProperty(pSet, EwOporRabPropertyNames.DlinaTravers, new IfcLengthMeasure(typeInfo.DlinaTravers.Value)); if (typeInfo.DlinaTravers1.HasValue) AddProperty(pSet, EwOporRabPropertyNames.DlinaTravers1, new IfcLengthMeasure(typeInfo.DlinaTravers1.Value)); if (typeInfo.DlinaTravers2.HasValue) AddProperty(pSet, EwOporRabPropertyNames.DlinaTravers2, new IfcLengthMeasure(typeInfo.DlinaTravers2.Value)); // Вылеты траверс if (typeInfo.WiletTravers.HasValue) AddProperty(pSet, EwOporRabPropertyNames.WiletTravers, new IfcLengthMeasure(typeInfo.WiletTravers.Value)); if (typeInfo.WiletTravers1.HasValue) AddProperty(pSet, EwOporRabPropertyNames.WiletTravers1, new IfcLengthMeasure(typeInfo.WiletTravers1.Value)); if (typeInfo.WiletTravers2.HasValue) AddProperty(pSet, EwOporRabPropertyNames.WiletTravers2, new IfcLengthMeasure(typeInfo.WiletTravers2.Value)); // Основание if (typeInfo.BaseX.HasValue) AddProperty(pSet, EwOporRabPropertyNames.BaseX, new IfcLengthMeasure(typeInfo.BaseX.Value)); if (typeInfo.BaseY.HasValue) AddProperty(pSet, EwOporRabPropertyNames.BaseY, new IfcLengthMeasure(typeInfo.BaseY.Value)); // Технические параметры AddProperty(pSet, EwOporRabPropertyNames.Tip, new IfcInteger(typeInfo.Tip ?? 0)); AddProperty(pSet, EwOporRabPropertyNames.Unom, new IfcInteger(typeInfo.Unom)); AddProperty(pSet, EwOporRabPropertyNames.UidOpRab, new IfcLabel(typeInfo.UidOpRab.ToString())); // Комментарий if (!string.IsNullOrEmpty(typeInfo.Comment)) AddProperty(pSet, EwOporRabPropertyNames.Comment, new IfcText(typeInfo.Comment)); return pSet; } public IfcTypeProduct CreateOporTypeDefinition(EwOporRab typeInfo) { var typeProduct = _ifcModel.Instances.New<IfcTypeProduct>(); typeProduct.Name = typeInfo.ShifrOp ?? "Unknown"; typeProduct.Description = typeInfo.Opis ?? $"Опора типа {typeInfo.ShifrOp}"; typeProduct.ApplicableOccurrence = ApplicableOccurrenceOpor; var propertySet = CreateTypePropertySet(typeInfo); typeProduct.HasPropertySets.Add(propertySet); return typeProduct; } private IfcPropertySet CreateEwProwodaRabPropertySet(EwProwodaRab prowod) { var pSet = _ifcModel.Instances.New<IfcPropertySet>(); pSet.Name = $"{EwProwodaRabPropertyNames.KorenPset}{prowod.Name_mark ?? prowod.UidProwRab.ToString().Substring(0, 8)}"; // Идентификаторы AddProperty(pSet, EwProwodaRabPropertyNames.UidRab , new IfcLabel(prowod.UidRab.ToString())); AddProperty(pSet, EwProwodaRabPropertyNames.UidProwRab, new IfcLabel(prowod.UidProwRab.ToString())); AddProperty(pSet, EwProwodaRabPropertyNames.Name_mark, new IfcText(prowod.Name_mark)); // Геометрические и физические параметры AddProperty(pSet, EwProwodaRabPropertyNames.Sprwd, new IfcLengthMeasure(prowod.Sprwd)); if (prowod.SprwdAl.HasValue) AddProperty(pSet, EwProwodaRabPropertyNames.SprwdAl, new IfcLengthMeasure(prowod.SprwdAl.Value)); if (prowod.SprwdSt.HasValue) AddProperty(pSet, EwProwodaRabPropertyNames.SprwdSt, new IfcLengthMeasure(prowod.SprwdSt.Value)); AddProperty(pSet, EwProwodaRabPropertyNames.DiamPrwd, new IfcLengthMeasure(prowod.DiamPrwd)); AddProperty(pSet, EwProwodaRabPropertyNames.Ppogon, new IfcMassMeasure(prowod.Ppogon)); // Механические характеристики if (prowod.SigMax.HasValue) AddProperty(pSet, EwProwodaRabPropertyNames.SigMax, new IfcReal(prowod.SigMax.Value)); AddProperty(pSet, EwProwodaRabPropertyNames.SigGol, new IfcReal(prowod.SigGol)); AddProperty(pSet, EwProwodaRabPropertyNames.SigSrG, new IfcReal(prowod.SigSrG)); AddProperty(pSet, EwProwodaRabPropertyNames.Alfa, new IfcReal(prowod.Alfa)); AddProperty(pSet, EwProwodaRabPropertyNames.Jung, new IfcReal(prowod.Jung)); // Температурные параметры if (prowod.Tekpl.HasValue) AddProperty(pSet, EwProwodaRabPropertyNames.Tekpl, new IfcReal(prowod.Tekpl.Value)); // Модули if (prowod.ModF.HasValue) AddProperty(pSet, EwProwodaRabPropertyNames.ModF, new IfcReal(prowod.ModF.Value)); if (prowod.ModD.HasValue) AddProperty(pSet, EwProwodaRabPropertyNames.ModD, new IfcReal(prowod.ModD.Value)); // Типы и классификация if (prowod.Type.HasValue) AddProperty(pSet, EwProwodaRabPropertyNames.Type, new IfcInteger(prowod.Type.Value)); if (prowod.TypeKonstr.HasValue) AddProperty(pSet, EwProwodaRabPropertyNames.TypeKonstr, new IfcInteger(prowod.TypeKonstr.Value)); // Служебные поля if (!string.IsNullOrEmpty(prowod.Comment)) AddProperty(pSet, EwProwodaRabPropertyNames.Comment, new IfcText(prowod.Comment)); if (!string.IsNullOrEmpty(prowod.Opis)) AddProperty(pSet, EwProwodaRabPropertyNames.Opis, new IfcText(prowod.Opis)); if (prowod.DataI.HasValue) AddProperty(pSet, EwProwodaRabPropertyNames.DataI, new IfcDateTime(prowod.DataI.Value.ToString("yyyy-MM-ddTHH:mm:ss"))); if (!string.IsNullOrEmpty(prowod.Polz)) AddProperty(pSet, EwProwodaRabPropertyNames.Polz, new IfcLabel(prowod.Polz)); return pSet; } public IfcTypeProduct CreateEwProwodTypeDefinition(EwProwodaRab typeInfo) { var typeProduct = _ifcModel.Instances.New<IfcTypeProduct>(); typeProduct.Name = typeInfo.Name_mark ?? "Unknown"; typeProduct.Description = typeInfo.Opis ?? $"Провод марки {typeInfo.Name_mark }"; typeProduct.ApplicableOccurrence = ApplicableOccurrenceProwod; var propertySet = CreateEwProwodaRabPropertySet(typeInfo); typeProduct.HasPropertySets.Add(propertySet); return typeProduct; } private IfcPropertySet CreateEwGirjlandRabPropertySet(EwGirjlandRab girjland) { var pSet = _ifcModel.Instances.New<IfcPropertySet>(); pSet.Name = $"{EwGirjlandRabPropertyNames.KorenPset}{girjland.Name ?? girjland.UidGirlRab.ToString().Substring(0, 8)}"; // Идентификаторы AddProperty(pSet, EwGirjlandRabPropertyNames.UidRab, new IfcLabel(girjland.UidRab.ToString())); AddProperty(pSet, EwGirjlandRabPropertyNames.UidGirlRab, new IfcLabel(girjland.UidGirlRab.ToString())); AddProperty(pSet, EwGirjlandRabPropertyNames.Code, new IfcLabel(girjland.Code)); AddProperty(pSet, EwGirjlandRabPropertyNames.Name, new IfcText(girjland.Name)); // Параметры гирлянды if (girjland.Tip.HasValue) AddProperty(pSet, EwGirjlandRabPropertyNames.Tip, new IfcInteger(girjland.Tip.Value)); if (girjland.Goal.HasValue) AddProperty(pSet, EwGirjlandRabPropertyNames.Goal, new IfcInteger(girjland.Goal.Value)); AddProperty(pSet, EwGirjlandRabPropertyNames.DlGirl, new IfcLengthMeasure(girjland.DlGirl)); AddProperty(pSet, EwGirjlandRabPropertyNames.MassGirl, new IfcMassMeasure(girjland.MassGirl)); if (girjland.Ssech.HasValue) AddProperty(pSet, EwGirjlandRabPropertyNames.Ssech, new IfcAreaMeasure(girjland.Ssech.Value)); if (girjland.Unom.HasValue) AddProperty(pSet, EwGirjlandRabPropertyNames.Unom, new IfcInteger(girjland.Unom.Value)); if (girjland.Zepnost.HasValue) AddProperty(pSet, EwGirjlandRabPropertyNames.Zepnost, new IfcInteger(girjland.Zepnost.Value)); if (girjland.Ballast.HasValue) AddProperty(pSet, EwGirjlandRabPropertyNames.Ballast, new IfcMassMeasure(girjland.Ballast.Value)); // Служебные поля if (girjland.DataI.HasValue) AddProperty(pSet, EwGirjlandRabPropertyNames.DataI, new IfcDateTime(girjland.DataI.Value.ToString("yyyy-MM-ddTHH:mm:ss"))); if (!string.IsNullOrEmpty(girjland.Polz)) AddProperty(pSet, EwGirjlandRabPropertyNames.Polz, new IfcLabel(girjland.Polz)); return pSet; } public IfcTypeProduct CreateEwGirljndTypeDefinition(EwGirjlandRab typeInfo) { var typeProduct = _ifcModel.Instances.New<IfcTypeProduct>(); typeProduct.Name = typeInfo.Code ?? "Unknown"; typeProduct.Description = typeInfo.Name ?? $"Гирлянда {typeInfo.Code }"; typeProduct.ApplicableOccurrence = ApplicableOccurrenceGirlind; var propertySet = CreateEwGirjlandRabPropertySet(typeInfo); typeProduct.HasPropertySets.Add(propertySet); return typeProduct; } #endregion } }