コード例 #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 IFAttribute CreateSection(ConcreteSection sectionProperty)
        {
            IFGeometricLine lusasGeometricLine = null;

            if (sectionProperty.SectionProfile != null)
            {
                lusasGeometricLine = d_LusasData.createGeometricLine(sectionProperty.DescriptionOrName());
                lusasGeometricLine.setValue("elementType", "3D Thick Beam");
                if (CreateProfile(sectionProperty.DescriptionOrName(), sectionProperty.SectionProfile as dynamic))
                {
                    if (!(sectionProperty.SectionProfile is TaperedProfile))
                    {
                        lusasGeometricLine.setFromLibrary("User Sections", "Local", sectionProperty.DescriptionOrName(), 0, 0);
                    }
                }
            }
            return(lusasGeometricLine);
        }
コード例 #3
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private IFAttribute CreateGeometricLine(ISectionProperty sectionProperty)
        {
            IFAttribute lusasAttribute;

            if (d_LusasData.existsAttribute("Line Geometric", sectionProperty.DescriptionOrName()))
            {
                lusasAttribute = d_LusasData.getAttribute("Line Geometric", sectionProperty.DescriptionOrName());
            }
            else
            {
                IFGeometricLine lusasGeometricLine = CreateSection(sectionProperty as dynamic);
                lusasAttribute = lusasGeometricLine;
            }

            if (lusasAttribute != null)
            {
                int adapterIdName = lusasAttribute.getID();
                sectionProperty.SetAdapterId(typeof(LusasId), adapterIdName);

                return(lusasAttribute);
            }

            return(null);
        }