Example #1
0
            public static bool Recognization(Wall wall)
            {
                _wall         = wall;
                _thickness    = wall.Width;
                _length       = wall.get_Parameter(BuiltInParameter.CURVE_ELEM_LENGTH).AsDouble();
                _level_bottom =
                    _doc.GetElement(wall.get_Parameter(BuiltInParameter.WALL_BASE_CONSTRAINT).AsElementId()) as Level;
                _level_top =
                    _doc.GetElement(wall.get_Parameter(BuiltInParameter.WALL_HEIGHT_TYPE).AsElementId()) as Level;
                _offset_bottom = wall.get_Parameter(BuiltInParameter.WALL_BASE_OFFSET).AsDouble();
                _offset_top    = wall.get_Parameter(BuiltInParameter.WALL_TOP_OFFSET).AsDouble();
                _noConsHeight  = wall.get_Parameter(BuiltInParameter.WALL_USER_HEIGHT_PARAM).AsDouble();

                _direction = GetWallDirection(wall);

                if (_direction == Direction.Undefined)
                {
                    _abandonWriter.WriteAbandonment(wall, AbandonmentTable.SkewWall);
                    return(false);
                }

                bool isFound;

                _floor_bottom =
                    _myLevel.GetFloor(out isFound, _level_bottom, _offset_bottom);
                _floor_top =
                    _myLevel.GetWallTopFloor(out isFound, _level_bottom, _offset_bottom, _noConsHeight);
                if (!isFound)
                {
                    --_floor_top;
                }

                if (!(MyLevel.isLegalFloorIndex(_floor_bottom) && MyLevel.isLegalFloorIndex(_floor_top)))
                {
                    _abandonWriter.WriteAbandonment(_wall as Element, AbandonmentTable.LevelNotFound);
                    return(false);
                }

                if (_floor_top <= _floor_bottom)
                {
                    _abandonWriter.WriteAbandonment(_wall as Element, AbandonmentTable.Wall_WallTooShort);
                    return(false);
                }

                _boundingBox = wall.get_BoundingBox(_doc.ActiveView);
                return(true);
            }
Example #2
0
            public static void UpdateToPGs()
            {
                bool isFound;

                _floor_bottom =
                    _myLevel.GetFloor(out isFound, _level_bottom, _offset_bottom);
                _floor_top =
                    _myLevel.GetWallTopFloor(out isFound, _level_bottom, _offset_bottom, _noConsHeight);

                if (!(MyLevel.isLegalFloorIndex(_floor_bottom) && MyLevel.isLegalFloorIndex(_floor_top)))
                {
                    _abandonWriter.WriteAbandonment(_wall as Element, AbandonmentTable.LevelNotFound);
                    return;
                }

                if (_floor_top <= _floor_bottom)
                {
                    _abandonWriter.WriteAbandonment(_wall, AbandonmentTable.Wall_WallTooShort);
                    return;
                }
                if (!isFound)
                {
                    --_floor_top;
                    if (_floor_top == MyLevel.GetLevelNum())
                    {
                        _abandonWriter.WriteAbandonment(_wall, AbandonmentTable.LevelOutOfRoof);
                        return;
                    }
                }
                if (_num_glass == 1)
                {
                    _isSetPGItem[(byte)_direction] = true;
                    while (_floor_bottom < _floor_top)
                    {
                        _PGItems[(byte)_direction].Num[_floor_bottom++] += 1.0;
                    }
                }
                else
                {
                    _isSetPGItem[(byte)_direction + 2] = true;
                    while (_floor_bottom < _floor_top)
                    {
                        _PGItems[(byte)_direction + 2].Num[_floor_bottom++] += 1.0;
                    }
                }
            }
Example #3
0
            public static void UpdateToPGs()
            {
                bool isFound;

                _floor_bottom =
                    _myLevel.GetFloor(out isFound, _level_bottom, _offset_bottom);
                _floor_top =
                    _myLevel.GetWallTopFloor(out isFound, _level_bottom, _offset_bottom, _noConsHeight);

                if (!(MyLevel.isLegalFloorIndex(_floor_bottom) && MyLevel.isLegalFloorIndex(_floor_top)))
                {
                    _abandonWriter.WriteAbandonment(_wall as Element, AbandonmentTable.LevelNotFound);
                    return;
                }

                if (_floor_top <= _floor_bottom)
                {
                    _abandonWriter.WriteAbandonment(_wall, AbandonmentTable.Wall_WallTooShort);
                    return;
                }
                if (!isFound)
                {
                    --_floor_top;
                    if (_floor_top == MyLevel.GetLevelNum())
                    {
                        _abandonWriter.WriteAbandonment(_wall, AbandonmentTable.LevelOutOfRoof);
                    }
                    else                                                //partial height
                    {
                        _area = _length * (_level_top.Elevation + _offset_top - _myLevel.GetElevation(_floor_top));
                        Update(WallHightMode.Partial);
                    }
                }
                while (_floor_bottom < _floor_top)                      //full height
                {
                    _area = _length * (_myLevel.GetElevation(_floor_top) - _myLevel.GetElevation(_floor_bottom));
                    Update(WallHightMode.Full);
                    ++_floor_bottom;
                }
            }