public ParkingBuilding(BlockReference blRef, string blName) : base(blRef, blName) { IdBlRef = blRef.Id; Height = Floors * 3; FriendlyTypeName = "Паркинг"; BuildingType = BuildingTypeEnum.Garage; var valPlaces = BlockBase.GetPropValue <string>(ParamPlaces, exactMatch: false); var resPlaces = AcadLib.Strings.StringHelper.GetStartInteger(valPlaces); if (resPlaces.Success) { Places = resPlaces.Value; } else { BlockBase.AddError($"Не определено кол машиномест из параметра {ParamPlaces} = {valPlaces}"); } // Полилиния контура var plContour = BlockBase.FindPolylineInLayer(LayerContour).FirstOrDefault(); if (plContour == null) { Inspector.AddError($"Не определена полилиния контура здания парковки на слое {LayerContour}.", IdBlRef, System.Drawing.SystemIcons.Warning); } else { IdPlContour = plContour.Id; } }
private int GetPlaces(string paramName) { int value = 0; string input = BlockBase.GetPropValue <string>(paramName, exactMatch: false); // 100 круглый var resInt = AcadLib.Strings.StringHelper.GetStartInteger(input); if (resInt.Success) { value = resInt.Value; } else { BlockBase.AddError($"Не определено '{paramName}' из параметра - {input}"); } return(value); }