Example #1
0
        public CurtainPanelInfo(Element p, bool ispanel) : this()
        {
            #region CurtainPanelInfo 初始化
            INF_ElementId = p.Id.IntegerValue;
            INF_Name      = p.Name;
            INF_ErrorInfo = $"{p.Id}";
            Parameter _param;
            if ((_param = p.LookupParameter("构件分项")).HasValue)
            {
                INF_Type = _param.AsInteger();
            }
            else
            {
                if (INF_Name.Contains("石材"))
                {
                    INF_Type = 51;
                }
                if (INF_Name.Contains("玻璃"))
                {
                    INF_Type = 52;
                }
                if (INF_Name.Contains("铝板"))
                {
                    INF_Type = 53;
                }
                if (INF_Name.Contains("百页"))
                {
                    INF_Type = 54;
                }
                if (INF_Name.Contains("立柱"))
                {
                    INF_Type = 61;
                }
            }

            XYZ _xyzOrigin = new XYZ();
            if (ispanel)
            {
                INF_Width_Metric  = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, p.get_Parameter(BuiltInParameter.CURTAIN_WALL_PANELS_WIDTH).AsDouble());
                INF_Height_Metric = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, p.get_Parameter(BuiltInParameter.CURTAIN_WALL_PANELS_HEIGHT).AsDouble());
                _xyzOrigin        = ((Panel)p).GetTransform().Origin;
            }
            else
            {
                INF_Width_Metric  = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, p.get_Parameter(BuiltInParameter.WINDOW_WIDTH).AsDouble());
                INF_Height_Metric = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, p.get_Parameter(BuiltInParameter.WINDOW_HEIGHT).AsDouble());
                _xyzOrigin        = (p.Location as LocationPoint).Point;
            }
            INF_OriginX_US     = _xyzOrigin.X;
            INF_OriginY_US     = _xyzOrigin.Y;
            INF_OriginZ_US     = _xyzOrigin.Z;
            INF_OriginX_Metric = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, _xyzOrigin.X);
            INF_OriginY_Metric = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, _xyzOrigin.Y);
            INF_OriginZ_Metric = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, _xyzOrigin.Z);

            #endregion
        }
Example #2
0
        public CurtainPanelInfo(Panel p) : this()
        {
            #region CurtainPanelInfo 初始化
            INF_ElementId = p.Id.IntegerValue;
            INF_Name      = p.Name;
            INF_ErrorInfo = $"{p.Id}";
            Parameter _param;
            if ((_param = p.get_Parameter("构件分项")).HasValue)
            {
                INF_Type = _param.AsInteger();
            }
            else
            {
                if (INF_Name.Contains("石材"))
                {
                    INF_Type = 51;
                }
                if (INF_Name.Contains("玻璃"))
                {
                    INF_Type = 52;
                }
                if (INF_Name.Contains("铝板"))
                {
                    INF_Type = 53;
                }
                if (INF_Name.Contains("百页"))
                {
                    INF_Type = 54;
                }
                if (INF_Name.Contains("立柱"))
                {
                    INF_Type = 61;
                }
            }

            INF_Width_Metric  = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, p.get_Parameter(BuiltInParameter.CURTAIN_WALL_PANELS_WIDTH).AsDouble());
            INF_Height_Metric = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, p.get_Parameter(BuiltInParameter.CURTAIN_WALL_PANELS_HEIGHT).AsDouble());
            XYZ _xyzOrigin = p.GetTransform().Origin;
            INF_OriginX_US     = _xyzOrigin.X;
            INF_OriginY_US     = _xyzOrigin.Y;
            INF_OriginZ_US     = _xyzOrigin.Z;
            INF_OriginX_Metric = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, _xyzOrigin.X);
            INF_OriginY_Metric = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, _xyzOrigin.Y);
            INF_OriginZ_Metric = Unit.CovertFromAPI(DisplayUnitType.DUT_MILLIMETERS, _xyzOrigin.Z);

            /**
             * if ((_param = p.get_Parameter("分区区号")).HasValue)
             * {
             *  INF_ZoneCode = _param.AsString();
             *  ResolveZoneCode();
             * }
             * else INF_ErrorInfo += $"[参数未设置:分区区号]";
             **/
            #endregion
        }