Exemplo n.º 1
0
        public int Fetch1dResults(string outputCase, double elementRef, Interop.gsa_8_7.ResHeader dataRef, int numOneDPos, out OneDResult oneDResult)
        {
            int numResultComponents;

            Interop.gsa_8_7.GsaResults[] gsaOneDResults;
            int status = gsaObject.Output_Init_Arr(0, "default", outputCase, dataRef, numOneDPos);

            if (status == 0 && gsaObject.Output_DataExist((int)elementRef) == 1)
            {
                gsaObject.Output_Extract_Arr((int)elementRef, out gsaOneDResults, out numResultComponents);

                //create the staggered array of data
                int        numDataPositions = gsaOneDResults.Count();
                double[][] values           = new double[numDataPositions][];
                for (int i = 0; i < numDataPositions; i++)
                {
                    values[i] = gsaOneDResults[i].dynaResults;
                }
                oneDResult = new OneDResult(values, gsaObject.Output_UnitString(), gsaObject.Output_DataTitle(1));
            }
            else
            {
                double[][] results = new double[1][];
                oneDResult = new OneDResult(results, "results were not created properly", "results were not created properly");
            }
            return(status);
        }
Exemplo n.º 2
0
        public int FetchNodeResults(string outputCase, Point3d nodePosition, Interop.gsa_8_7.ResHeader dataRef, out NodeResult nodeResults)
        {
            int nodeComp;

            Interop.gsa_8_7.GsaResults[] gsaNodeResults;
            long nodeRef = gsaObject.Gen_NodeAt(nodePosition.X, nodePosition.Y, nodePosition.Z, 0.1);
            int  status  = gsaObject.Output_Init_Arr(0, "default", outputCase, dataRef, 0);

            if (status == 0 && gsaObject.Output_DataExist((int)nodeRef) == 1)
            {
                gsaObject.Output_Extract_Arr((int)nodeRef, out gsaNodeResults, out nodeComp);
                //create the NodeResult struct
                nodeResults = new NodeResult(gsaNodeResults[0].dynaResults, gsaObject.Output_UnitString(), gsaObject.Output_DataTitle(1));
            }
            else
            {
                //need to initialise to complete the out input requirements
                nodeResults = new NodeResult();
            }
            return(status);
        }