protected override void SolveInstance(IGH_DataAccess DA)
        {
            ETABS2013.cOAPI ETABS    = null;
            string          loadcase = null;

            if (!DA.GetData(0, ref ETABS))
            {
                return;
            }
            if (!DA.GetData(1, ref loadcase))
            {
                return;
            }

            //Gets the ETABS geometry
            int numberNames = 0;

            string[] shellList = null;
            ETABS.SapModel.AreaObj.GetNameList(ref numberNames, ref shellList);

            List <int>        IDs        = new List <int>();
            List <double>     svmtopList = new List <double>();
            DataTree <double> svmtopTree = new DataTree <double>();
            List <double>     svmbotList = new List <double>();

            List <double> s11topList = new List <double>();
            List <double> s22topList = new List <double>();
            List <double> s12topList = new List <double>();

            List <double> s11botList = new List <double>();
            List <double> s12botList = new List <double>();
            List <double> s22botList = new List <double>();
            int           ret;

            ret = ETABS.SapModel.Results.Setup.SetCaseSelectedForOutput(loadcase);

            for (int i = 0; i < shellList.Count(); i++)
            {
                //Define all output arrays
                ETABS2013.eItemTypeElm ItemTypeElm = new ETABS2013.eItemTypeElm();
                int      NumberResults             = 20;
                string[] obj       = new string[100];
                string[] elm       = new string[100];
                string[] PointElm  = new string[100];
                string[] LoadCase  = new string[100];
                string[] StepType  = new string[100];
                double[] StepNum   = new double[100];
                double[] s11top    = new double[100];
                double[] s22top    = new double[100];
                double[] s12top    = new double[100];
                double[] smaxtop   = new double[100];
                double[] smintop   = new double[100];
                double[] sangletop = new double[100];
                double[] svmtop    = new double[100];
                double[] s11bot    = new double[100];
                double[] s22bot    = new double[100];
                double[] s12bot    = new double[100];
                double[] smaxbot   = new double[100];
                double[] sminbot   = new double[100];
                double[] sanglebot = new double[100];
                double[] svmbot    = new double[100];
                double[] s13avg    = new double[100];
                double[] s23avg    = new double[100];
                double[] smaxavg   = new double[100];
                double[] sangleavg = new double[100];
                double[] U1        = new double[100];
                double[] U2        = new double[100];
                double[] U3        = new double[100];
                double[] R1        = new double[100];
                double[] R2        = new double[100];
                double[] R3        = new double[100];
                //Gets the analysis results
                ret = ETABS.SapModel.Results.AreaStressShell(shellList[i], ItemTypeElm, ref NumberResults, ref obj, ref elm, ref PointElm, ref LoadCase, ref StepType, ref StepNum, ref s11top,
                                                             ref s22top, ref s12top, ref smaxtop, ref smintop, ref sangletop, ref svmtop, ref s11bot, ref s22bot, ref s12bot, ref smaxbot,
                                                             ref sminbot, ref sanglebot, ref svmbot, ref s13avg, ref s23avg, ref smaxavg, ref sangleavg);


                for (int j = 0; j < svmtop.Count(); j++)
                {
                    int[] pathInts = new int[2];
                    pathInts[0] = i;
                    pathInts[1] = j;
                    GH_Path path = new GH_Path(pathInts);
                    svmtopTree.Add(svmtop[j], path);
                }
                int ID = Convert.ToInt32(shellList[i]);
                IDs.Add(ID);
                svmtopList.Add(svmtop.Max());
                svmbotList.Add(svmbot.Max());
                s11topList.Add(s11top.Max());
                s22topList.Add(s22top.Max());
                s12topList.Add(s12top.Max());
            }

            //TODO: Find out which ones of these are of interest
            DA.SetDataList("Shell Identities", IDs);
            if (_showsSVMtop)
            {
                DA.SetDataList("svmtop", svmtopList);
            }
            if (_showsSVMbot)
            {
                DA.SetDataList("svmbot", svmbotList);
            }
            if (_shows11top)
            {
                DA.SetDataList("s11top", s11topList);
            }
            if (_shows12top)
            {
                DA.SetDataList("s12top", s12topList);
            }
            if (_shows22top)
            {
                DA.SetDataList("s22top", s22topList);
            }
        }
示例#2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            ETABS2013.cOAPI ETABS    = null;
            string          loadcase = null;

            if (!DA.GetData(0, ref ETABS))
            {
                return;
            }
            if (!DA.GetData(1, ref loadcase))
            {
                return;
            }

            int numberResults = 0;

            ETABS2013.eItemTypeElm ItemTypeElm = new ETABS2013.eItemTypeElm();
            string[] obj           = new string[0];
            string[] elm           = new string[0];
            string[] loadcaseArray = new string[1];
            loadcaseArray[0] = loadcase;
            string[] StepType = new string[100];
            double[] StepNum  = new double[100];
            double[] U1       = new double[100];
            double[] U2       = new double[100];
            double[] U3       = new double[100];
            double[] R1       = new double[100];
            double[] R2       = new double[100];
            double[] R3       = new double[100];

            //Creates output lists
            List <int>    IDs    = new List <int>();
            List <double> U1list = new List <double>();
            List <double> U2list = new List <double>();
            List <double> U3list = new List <double>();
            List <double> R1list = new List <double>();
            List <double> R2list = new List <double>();
            List <double> R3list = new List <double>();

            //Gets point objects
            int numberNames = 0;

            string[] myName = new string[0];
            ETABS.SapModel.PointObj.GetNameList(ref numberNames, ref myName);

            int ret;

            ret = ETABS.SapModel.Results.Setup.SetCaseSelectedForOutput(loadcase);

            int commonto = 0;


            for (int i = 0; i < myName.Count(); i++)
            {
                ETABS.SapModel.PointObj.GetCommonTo(myName[i], ref commonto);
                ETABS.SapModel.Results.JointDispl(myName[i], ItemTypeElm, ref numberResults, ref obj, ref elm, ref loadcaseArray, ref StepType, ref StepNum, ref U1, ref U2, ref U3, ref R1, ref R2, ref R3);
                int ID = Convert.ToInt32(myName[i]);
                IDs.Add(ID);
                U1list.Add(U1[0]);
                U2list.Add(U2[0]);
                U3list.Add(U3[0]);
                R1list.Add(R1[0]);
                R2list.Add(R2[0]);
                R3list.Add(R3[0]);
            }

            //outputting the etabsobj even though nothing has changed... to be able to extract other analysis results before next iteration in a loop.
            //Is there a better way to do this?
            DA.SetData(0, ETABS);
            DA.SetDataList(1, IDs);
            DA.SetDataList(2, U1list);
            DA.SetDataList(3, U2list);
            DA.SetDataList(4, U3list);
            DA.SetDataList(5, R1list);
            DA.SetDataList(6, R2list);
            DA.SetDataList(7, R3list);
        }
示例#3
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            ETABS2013.cOAPI ETABS    = null;
            string          loadcase = null;

            if (!DA.GetData(0, ref ETABS))
            {
                return;
            }
            if (!DA.GetData(1, ref loadcase))
            {
                return;
            }

            //Gets the ETABS geometry
            int numberNames = 0;

            string[] frameList = null;
            ETABS.SapModel.FrameObj.GetNameList(ref numberNames, ref frameList);

            List <int>    IDs    = new List <int>();
            List <double> PList  = new List <double>();
            List <double> V2List = new List <double>();
            List <double> V3List = new List <double>();
            int           ret;

            ret = ETABS.SapModel.Results.Setup.SetCaseSelectedForOutput(loadcase);

            for (int i = 0; i < frameList.Count(); i++)
            {
                //Define all output arrays
                ETABS2013.eItemTypeElm ItemTypeElm = new ETABS2013.eItemTypeElm();
                int      NumberResults             = 20;
                string[] obj      = new string[100];
                double[] objSta   = new double[100];
                string[] elm      = new string[100];
                double[] elmSta   = new double[100];
                string[] PointElm = new string[100];
                string[] LoadCase = new string[100];
                string[] StepType = new string[100];
                double[] StepNum  = new double[100];
                double[] P        = new double[100];
                double[] V2       = new double[100];
                double[] V3       = new double[100];
                double[] T        = new double[100];
                double[] M2       = new double[100];
                double[] M3       = new double[100];
                //Gets the analysis results
                ret = ETABS.SapModel.Results.FrameForce(frameList[i], ItemTypeElm, ref NumberResults, ref obj, ref objSta, ref elm, ref elmSta, ref LoadCase, ref StepType, ref StepNum, ref P, ref V2, ref V3, ref T, ref M2, ref M3);

                //TODO: find out what's interesting
                int ID = Convert.ToInt32(frameList[i]);
                IDs.Add(ID);
                PList.Add(P.Max());
                V2List.Add(V2.Max());
                V3List.Add(V3.Max());
            }
            DA.SetDataList(0, IDs);
            DA.SetDataList(1, PList);
            DA.SetDataList(2, V2List);
            DA.SetDataList(3, V3List);
        }