예제 #1
0
        public static List <PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
        {
            _doc           = doc;
            _addiInfo      = addiInfo;
            _myLevel       = MyLevel.GetMyLevel();
            _abandonWriter = AbandonmentWriter.GetWriter();
            _PGItems       = new List <PGItem>(4);
            _Storefronts   = new List <Wall>(10);
            _isSetPGItem   = new bool[4];

            double Price         = addiInfo.prices[(byte)PGComponents.Storefront];
            bool   IfDefinePrice = Price == 0.0 ? false : true;

            string[]    temp_code = { "B2023.001", "B2023.002" };
            Direction[] temp_dire = { Direction.X, Direction.Y };
            for (int i = 0; i < 2; ++i)
            {
                for (int j = 0; j < 2; ++j)
                {
                    PGItem pgItem = new PGItem();
                    pgItem.Code          = temp_code[i];
                    pgItem.direction     = temp_dire[j];
                    pgItem.PGName        = "店面";
                    pgItem.PinYinSuffix  = "DianMian";
                    pgItem.IfDefinePrice = IfDefinePrice;
                    pgItem.Price         = Price;

                    _PGItems.Add(pgItem);
                }
            }

            ExtractObjects();
            Process();
            return(_PGItems);
        }
예제 #2
0
        public static List <PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
        {
            _doc           = doc;
            _addiInfo      = addiInfo;
            _myLevel       = MyLevel.GetMyLevel();
            _abandonWriter = AbandonmentWriter.GetWriter();
            _PGItems       = new List <PGItem>(4);

            _GypWalls     = new List <RichWall>(10);
            _GeneticWalls = new List <RichWall>(6);

            if (_addiInfo.requiredComp[(byte)PGComponents.GypWall] && _addiInfo.requiredComp[(byte)PGComponents.WallFinish])
            {
                _reportRule = ReportRule.Both;
            }
            else if (_addiInfo.requiredComp[(byte)PGComponents.GypWall])
            {
                _reportRule = ReportRule.Gyp;
            }
            else
            {
                _reportRule = ReportRule.Finish;
            }

            ExtractObjects();
            Process();
            return(_PGItems);
        }
예제 #3
0
 public AMEPEquip(Document doc, AdditionalInfo addiInfo)
 {
     _doc           = doc;
     _addiInfo      = addiInfo;
     _myLevel       = MyLevel.GetMyLevel();
     _abandonWriter = AbandonmentWriter.GetWriter();
     _PGItems       = null;
     _equips        = null;
     _mepRecog      = null;
 }
예제 #4
0
 public static List <PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
 {
     _doc           = doc;
     _addiInfo      = addiInfo;
     _myLevel       = MyLevel.GetMyLevel();
     _abandonWriter = AbandonmentWriter.GetWriter();
     _slabs         = new List <Floor>(20);
     _PGItems       = new List <PGItem>(10);
     ExtractObjects();
     Process();
     return(_PGItems);
 }
예제 #5
0
 public static List<PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
 {
     _doc = doc;
     _addiInfo = addiInfo;
     _myLevel = MyLevel.GetMyLevel();
     _abandonWriter = AbandonmentWriter.GetWriter();
     _slabs = new List<Floor>(20);
     _PGItems = new List<PGItem>(10);
     ExtractObjects();
     Process();
     return _PGItems;
 }
예제 #6
0
 public static List <PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
 {
     _doc           = doc;
     _addiInfo      = addiInfo;
     _myLevel       = MyLevel.GetMyLevel();
     _abandonWriter = AbandonmentWriter.GetWriter();
     _PGItems       = new List <PGItem>(1);
     _StruColumns   = new List <ElementId>(50);
     _StruBeams     = new List <ElementId>(150);
     ExtractObjects();
     Process();
     return(_PGItems);
 }
예제 #7
0
 public static List<PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
 {
     _doc = doc;
     _addiInfo = addiInfo;
     _myLevel = MyLevel.GetMyLevel();
     _abandonWriter = AbandonmentWriter.GetWriter();
     _PGItems = new List<PGItem>(1);
     _StruColumns = new List<ElementId>(50);
     _StruBeams = new List<ElementId>(150);
     ExtractObjects();
     Process();
     return _PGItems;
 }
예제 #8
0
        protected bool TryGetFIFloor(Document doc)
        {
            Level  level  = doc.GetElement(_fi.LevelId) as Level;
            double offset = _fi.get_Parameter(BuiltInParameter.INSTANCE_FREE_HOST_OFFSET_PARAM).AsDouble();
            bool   isFound;

            _floor = MyLevel.GetMyLevel().GetFloor(out isFound, level, offset);
            if (MyLevel.GetLevelNum() <= _floor)
            {
                AbandonmentWriter.GetWriter().WriteAbandonment(_fi, AbandonmentTable.LevelOutOfRoof);
                return(false);
            }
            else
            {
                return(true);
            }
        }
예제 #9
0
        public static List<PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
        {
            _doc = doc;
            _addiInfo = addiInfo;
            _myLevel = MyLevel.GetMyLevel();
            _abandonWriter = AbandonmentWriter.GetWriter();
            _PGItems = new List<PGItem>(4);

            _GypWalls = new List<RichWall>(10);
            _GeneticWalls = new List<RichWall>(6);

            if (_addiInfo.requiredComp[(byte)PGComponents.GypWall] && _addiInfo.requiredComp[(byte)PGComponents.WallFinish])
                _reportRule = ReportRule.Both;
            else if (_addiInfo.requiredComp[(byte)PGComponents.GypWall]) _reportRule = ReportRule.Gyp;
            else _reportRule = ReportRule.Finish;

            ExtractObjects();
            Process();
            return _PGItems;
        }
예제 #10
0
        public Result Execute(ExternalCommandData revit, ref string message, ElementSet elements)
        {
            ErrorWriter.SetWriter();
            ErrorWriter errorWriter = ErrorWriter.GetWriter();

            //FireProtectionColl fireProColl = new FireProtectionColl();
            try
            {
                //Get Doc
                UIDocument uidoc = revit.Application.ActiveUIDocument;
                Document   doc   = uidoc.Document;
                //Set Level
                FilteredElementCollector LevelCollector = new FilteredElementCollector(doc);
                ElementFilter            LevelFilter    = new ElementClassFilter(typeof(Level));
                LevelCollector.WherePasses(LevelFilter);
                MyLevel.SetMyLevel(LevelCollector);
                //IO
                DoOutput(doc);
                //fireProColl.OutputIN2(doc);
                Process process = Process.Start(PGPath.exeDirectory + "PGCreator.exe", PGPath.exeDirectory);
                process.WaitForExit();
                char[] outFile = IOHelper.Input("PGCTF.OUT");
                IOHelper.Output("1", "PGCTF.OUT");
                IOHelper.TryHideFile("PGCTF.OUT");
                //Process
                if (outFile[0] == '0')
                {
                    MEPHelper.ReadBinFile();
                    AdditionalInfo addiInfo = new AdditionalInfo(outFile);
                    MyLevel.AdjustLevels(addiInfo);
                    PGWriter.SetWriter(addiInfo);
                    AbandonmentWriter.SetWriter(addiInfo);
                    PGWriter pgWriter = PGWriter.GetWriter();

                    if (addiInfo.requiredComp[(byte)PGComponents.BeamColumnJoint])
                    {
                        pgWriter.UpdatePGs(PBeamColumnJoints.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.ShearWall])
                    {
                        pgWriter.UpdatePGs(PShearWall.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.GypWall] ||
                        addiInfo.requiredComp[(byte)PGComponents.WallFinish])
                    {
                        pgWriter.UpdatePGs(PGypWall.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.CurtainWall])
                    {
                        pgWriter.UpdatePGs(PCurtainWall.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.Storefront])
                    {
                        pgWriter.UpdatePGs(PStorefront.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.Ceiling] ||
                        addiInfo.requiredComp[(byte)PGComponents.CeilingLighting])
                    {
                        pgWriter.UpdatePGs(PCeiling.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.MasonryWall])
                    {
                        pgWriter.UpdatePGs(PMasonryWall.GetPG(doc, addiInfo));
                    }

                    if (addiInfo.requiredComp[(byte)PGComponents.Duct])
                    {
                        pgWriter.UpdatePGs(PDuct.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.Pipe])
                    {
                        pgWriter.UpdatePGs(PPipe.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.Chiller])
                    {
                        pgWriter.UpdatePGs((new PChiller(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.CoolingTower])
                    {
                        pgWriter.UpdatePGs((new PCoolingTower(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.Compressor])
                    {
                        pgWriter.UpdatePGs((new PCompressor(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.HVACFan_InLine])
                    {
                        pgWriter.UpdatePGs((new PHVACFan_InLine(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.Diffuser])
                    {
                        pgWriter.UpdatePGs((new PDiffuser(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.VAV])
                    {
                        pgWriter.UpdatePGs((new PVAV(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.HVACFan])
                    {
                        pgWriter.UpdatePGs((new PHVACFan(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.AHU])
                    {
                        pgWriter.UpdatePGs((new PAHU(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.ControlPanel])
                    {
                        pgWriter.UpdatePGs((new PControlPanel(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.FireSprinkler])
                    {
                        pgWriter.UpdatePGs((new PFireSprinkler(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.Transformer])
                    {
                        pgWriter.UpdatePGs((new PTransformer(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.MCC])
                    {
                        pgWriter.UpdatePGs((new PMCC(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.LVS])
                    {
                        pgWriter.UpdatePGs((new PLVS(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.DistPanel])
                    {
                        pgWriter.UpdatePGs((new PDistPanel(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.BatteryRack])
                    {
                        pgWriter.UpdatePGs((new PBatteryRack(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.BatteryCharger])
                    {
                        pgWriter.UpdatePGs((new PBatteryCharger(doc, addiInfo)).GetPG());
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.DieselGen])
                    {
                        pgWriter.UpdatePGs((new PDieselGen(doc, addiInfo)).GetPG());
                    }

                    if (addiInfo.requiredComp[(byte)PGComponents.BracedFrame])
                    {
                        pgWriter.UpdatePGs(PBracedFrame.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.SteelBCJoint])
                    {
                        pgWriter.UpdatePGs(PStealBCJoints.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.FlatSlab])
                    {
                        pgWriter.UpdatePGs(PFlatSlab.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.LinkBeam])
                    {
                        pgWriter.UpdatePGs(PLinkBeam.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.Stair])
                    {
                        pgWriter.UpdatePGs(PStair.GetPG(doc, addiInfo));
                    }
                    if (addiInfo.requiredComp[(byte)PGComponents.Roof])
                    {
                        pgWriter.UpdatePGs(PRoof.GetPG(doc, addiInfo));
                    }
                    normalExit = true;
                }
            }
            catch (Exception e)
            {
                errorWriter.WriteError(e);
                normalExit = false;
                TaskDialog.Show("PGCreator", "未能正确导出性能组,请与软件提供者联系");
            }
            finally
            {
                ErrorWriter.Output();
                if (normalExit)
                {
                    AbandonmentWriter.Output();
                    PGWriter.Output();
                    TaskDialog.Show("PGCreator", "性能组导出成功!");
                }
            }
            return(Result.Succeeded);
        }