Ejemplo n.º 1
0
        public static bool TBDSizing(string tbdFile, bool run = false)
        {
            if (!run)
            {
                return(false);
            }

            if (string.IsNullOrEmpty(tbdFile))
            {
                BH.Engine.Base.Compute.RecordError("Please provide a valid TBD file path");
                return(false);
            }

            TBDDocument tbdDocument = new TBDDocument();

            tbdDocument.open(tbdFile);
            if (tbdDocument != null)
            {
                tbdDocument.sizing(0);
            }
            tbdDocument.save();
            tbdDocument.close();

            int intrefcountTBD = 0;

            do
            {
                intrefcountTBD = Marshal.FinalReleaseComObject(tbdDocument);
            } while (intrefcountTBD > 0);
            tbdDocument = null;

            return(true);
        }
Ejemplo n.º 2
0
        public static bool TBDSizing(string tbdFile, int startDay = 0, int endDay = 365, bool autoViewResults = false, bool run = false)
        {
            if (!run)
            {
                return(false);
            }

            if (!run)
            {
                return(false);
            }

            if (string.IsNullOrEmpty(tbdFile))
            {
                BH.Engine.Base.Compute.RecordError("Please provide a valid TBD file path");
                return(false);
            }

            TBDDocument tbdDocument = new TBDDocument();

            tbdDocument.open(tbdFile);

            string tsdFile = tbdFile.Replace(".tbd", ".tsd");

            if (tbdDocument != null)
            {
                tbdDocument.simulate(startDay, endDay, autoViewResults ? 1 : 0, 1, 0, 0, tsdFile, 0, 0);
                tbdDocument.save();
                tbdDocument.close();
            }

            int intrefcountTBD = 0;

            do
            {
                intrefcountTBD = Marshal.FinalReleaseComObject(tbdDocument);
            } while (intrefcountTBD > 0);
            tbdDocument = null;

            return(true);
        }