示例#1
0
        /***************************************************/

        private bool CreateProfile(string name, TaperedProfile profile)
        {
            profile.MapPositionDomain();

            IFGeometricLine lusasGeometricLine = (IFGeometricLine)d_LusasData.getAttribute("Line Geometric", name);

            lusasGeometricLine.setMultipleVarying(true);
            lusasGeometricLine.setNumberOfSections(profile.Profiles.Count);
            lusasGeometricLine.setValue("interpMethod", "Enhanced");
            lusasGeometricLine.setSpecifyInterp(true);
            lusasGeometricLine.setEqualSpacing(false);
            lusasGeometricLine.setSymmetry(false);
            lusasGeometricLine.setDistanceType("Parametric");

            List <double> keys = new List <double>(profile.Profiles.Keys);
            IProfile      iProfile;

            for (int i = 0; i < keys.Count; i++)
            {
                profile.Profiles.TryGetValue(keys[i], out iProfile);
                string profileName;
                if (i == 0)
                {
                    profileName = $"{name}-0";
                }
                else
                {
                    profileName = $"{name}-{keys[i]:G3}";
                }

                CreateProfile(profileName, iProfile as dynamic);
                lusasGeometricLine.setFromLibrary("User Sections", "Local", profileName, 0, 0, i);
                if (i == 0)
                {
                    lusasGeometricLine.setInterpolation("Constant", (double)keys[i], i);
                }
                else
                {
                    lusasGeometricLine.setInterpolation("Function", (double)keys[i], i, profile.InterpolationOrder[i - 1]);
                }
            }

            lusasGeometricLine.setVerticalAlignment("CenterToCenter");
            lusasGeometricLine.setHorizontalAlignment("CenterToCenter");
            lusasGeometricLine.setAlignmentSection(1);

            return(true);
        }
示例#2
0
        /***************************************************/

        private bool SetProfile(TaperedProfile taperProfile, string sectionName, string matName)
        {
            //Check and fix taperProfile
            taperProfile.MapPositionDomain();

            //Decompose the taperProfile dictionary
            IProfile[] profiles  = taperProfile.Profiles.Values.ToArray();
            double[]   positions = taperProfile.Profiles.Keys.ToArray();

            //Add the sub-profiles to the model and create a list of names
            string[] profNames = new string[profiles.Length];
            for (int i = 0; i < profiles.Length; i++)
            {
                profNames[i] = !string.IsNullOrEmpty(profiles[i].Name)? profiles[i].Name : sectionName + $"_{i}";
                SetProfile(profiles[i] as dynamic, profNames[i], matName);
            }

            //initialize SAP inputs
            int nSegments = profiles.Length - 1;

            string[] startSec = new string[nSegments];
            string[] endSec   = new string[nSegments];
            double[] myLength = new double[nSegments];
            int[]    myType   = new int[nSegments];
            int[]    EI33     = taperProfile.InterpolationOrder.ToArray();
            int[]    EI22     = taperProfile.InterpolationOrder.ToArray();

            //Convert list of stations to list of segments
            for (int i = 1; i <= nSegments; i++)
            {
                startSec[i - 1] = profNames[i - 1];
                endSec[i - 1]   = profNames[i];
                myLength[i - 1] = positions[i] - positions[i - 1];
                myType[i - 1]   = 1;
            }

            //Send the tapered profile to SAP
            return(m_model.PropFrame.SetNonPrismatic(sectionName, nSegments, ref startSec, ref endSec, ref myLength, ref myType, ref EI33, ref EI22) == 0);
        }
示例#3
0
        /***************************************************/

        private bool SetProfile(TaperedProfile profile, string sectionName, IMaterialFragment material)
        {
            //Map Position domain to [0,1]
            profile.MapPositionDomain();

            // Create a section for each sub profile
            IProfile[] profiles = profile.Profiles.Values.ToArray();
            for (int i = 0; i < profiles.Length; i++)
            {
                ISetProfile(profiles[i], sectionName + "_SubSection" + i.ToString(), material);
            }

            // Declare some variables
            int num = profile.Profiles.Count - 1;

            string[] segmentStartProfile = new string[num];
            string[] segmentEndProfile   = new string[num];
            double[] length = new double[num];

            // Formatt section names and positions to ETABS standard
            double[] positions = profile.Profiles.Keys.ToArray();
            for (int i = 0; i < num; i++)
            {
                segmentStartProfile[i] = sectionName + "_SubSection" + (i).ToString();

                // Etabs reads this in mm, and multiplying strictly does not matter (since they're relative values), but is easier on the eyes in ETBAS later
                length[i]            = System.Convert.ToDouble(positions[i + 1] - positions[i]) * 1000;
                segmentEndProfile[i] = sectionName + "_SubSection" + (i + 1).ToString();
            }

            // Some array settings
            int[] type = length.Select(x => 1).ToArray <int>(); // Relative Length values, (No idea what happens or why someone would mix thease)
            int[] eI33 = length.Select(x => 1).ToArray <int>(); // Linear variation of EI33
            int[] eI22 = length.Select(x => 1).ToArray <int>(); // Linear variation of EI22
            Engine.Base.Compute.RecordNote("Tapered Sections Properties are set to vary linearly along the element in ETABS.");

            return(m_model.PropFrame.SetNonPrismatic(sectionName, num, ref segmentStartProfile, ref segmentEndProfile, ref length, ref type, ref eI33, ref eI22) == 0);
        }