Ejemplo n.º 1
0
        public ETABSSpringProperty SpringPropertyToSpeckle(string name)
        {
            double[] stiffness    = null;
            int      springOption = 0;
            string   Cys          = null;
            string   soilProfile  = null;
            string   footing      = null;
            double   period       = 0;
            int      color        = 0;
            string   notes        = null;
            string   GUID         = null;

            Model.PropPointSpring.GetPointSpringProp(name, ref springOption, ref stiffness, ref Cys, ref soilProfile, ref footing, ref period, ref color, ref notes, ref GUID);
            switch (springOption)
            {
            case 1:
                ETABSSpringProperty speckleSpringProperty = new ETABSSpringProperty(name, Cys, stiffness[0], stiffness[1], stiffness[2], stiffness[3], stiffness[4], stiffness[5]);
                speckleSpringProperty.applicationId = GUID;
                return(speckleSpringProperty);

            case 2:
                speckleSpringProperty = new ETABSSpringProperty(name, soilProfile, footing, period);
                speckleSpringProperty.applicationId = GUID;
                return(speckleSpringProperty);

            default:
                speckleSpringProperty = new ETABSSpringProperty();
                return(speckleSpringProperty);
            }
        }
Ejemplo n.º 2
0
        public void SpringPropertyToNative(ETABSSpringProperty springProperty)
        {
            double[] k = new double[6];
            k[0] = springProperty.stiffnessX;
            k[1] = springProperty.stiffnessY;
            k[2] = springProperty.stiffnessZ;
            k[3] = springProperty.stiffnessXX;
            k[4] = springProperty.stiffnessYY;
            k[5] = springProperty.stiffnessZZ;
            switch (springProperty.springOption)
            {
            case SpringOption.Link:
                var springOption = 1;
                Model.PropPointSpring.SetPointSpringProp(springProperty.name, springOption, ref k, springProperty.CYs, iGUID: springProperty.applicationId);
                break;

            case SpringOption.SoilProfileFooting:
                springOption = 2;
                throw new NotSupportedException();
                break;
            }
        }