Exemple #1
0
        public override SAPSection GetInitialSection(SAPMaterial mat)
        {
            ISectionAssumption assumption = ISectionAssumption.GetInitialSection();

            StringBuilder nameStr = new StringBuilder();

            nameStr.Append("I ");
            nameStr.Append(assumption.Height * 100);
            nameStr.Append("x");
            nameStr.Append(assumption.WebThickness * 100);

            nameStr.Append("/");
            nameStr.Append(assumption.TopFlangeWidth * 100);
            nameStr.Append("x");
            nameStr.Append(assumption.TopFlangeThickness * 100);
            nameStr.Append("/");
            nameStr.Append(assumption.BotFlangeWidth * 100);
            nameStr.Append("x");
            nameStr.Append(assumption.BotFlangeThickness * 100);
            if (assumption == null)
            {
                return(null);
            }
            SAPISection sec = new SAPISection(nameStr.ToString(), mat, mat, mat
                                              , assumption.Height, assumption.TopFlangeWidth, assumption.TopFlangeThickness, assumption.BotFlangeWidth, assumption.BotFlangeThickness, assumption.WebThickness);

            return(sec);
        }
Exemple #2
0
        internal static SAPISection GetAssumedEndTaperSection(SAPISection startSection)
        {
            ISectionAssumption previous = new ISectionAssumption(startSection.Height, startSection.BotFlangeWidth, startSection.BotFlangeThickness, startSection.WebThickness);
            ISectionAssumption next     = ISectionAssumption.GetNextEndTaperAssumption(previous);

            StringBuilder nameStr = new StringBuilder();

            nameStr.Append("I ");
            nameStr.Append(next.Height * 100);
            nameStr.Append("x");
            nameStr.Append(next.WebThickness * 100);

            nameStr.Append("/");
            nameStr.Append(next.TopFlangeWidth * 100);
            nameStr.Append("x");
            nameStr.Append(next.TopFlangeThickness * 100);
            nameStr.Append("/");
            nameStr.Append(next.BotFlangeWidth * 100);
            nameStr.Append("x");
            nameStr.Append(next.BotFlangeThickness * 100);
            if (next == null)
            {
                return(null);
            }

            SAPISection sec = new SAPISection(nameStr.ToString(), startSection.WebMaterial, startSection.TopFlangeMaterial, startSection.BotFlangeMaterial
                                              , next.Height, next.TopFlangeWidth, next.TopFlangeThickness, next.BotFlangeWidth, next.BotFlangeThickness, next.WebThickness);

            return(sec);
        }
Exemple #3
0
        public override SAPSection GetAssumedSection()
        {
            ISectionAssumption previous = new ISectionAssumption(Height, BotFlangeWidth, BotFlangeThickness, WebThickness);
            ISectionAssumption next     = ISectionAssumption.GetNextAssumption(previous);

            StringBuilder nameStr = new StringBuilder();

            nameStr.Append("I ");
            nameStr.Append(next.Height * 100);
            nameStr.Append("x");
            nameStr.Append(next.WebThickness * 100);

            nameStr.Append("/");
            nameStr.Append(next.TopFlangeWidth * 100);
            nameStr.Append("x");
            nameStr.Append(next.TopFlangeThickness * 100);
            nameStr.Append("/");
            nameStr.Append(next.BotFlangeWidth * 100);
            nameStr.Append("x");
            nameStr.Append(next.BotFlangeThickness * 100);
            if (next == null)
            {
                return(null);
            }

            SAPISection sec = new SAPISection(nameStr.ToString(), WebMaterial, TopFlangeMaterial, BotFlangeMaterial
                                              , next.Height, next.TopFlangeWidth, next.TopFlangeThickness, next.BotFlangeWidth, next.BotFlangeThickness, next.WebThickness);

            return(sec);
        }
        public override SAPSection GetInitialSection(SAPMaterial mat)
        {
            SAPISection startSection = new SAPISection();
            SAPISection endSection   = new SAPISection();

            startSection.GetInitialSection(mat);
            startSection.GetInitialSection(mat);
            endSection.Height *= 3;

            StringBuilder nameStr = new StringBuilder();

            nameStr.Append("I ");
            nameStr.Append(startSection.Height * 100);
            nameStr.Append("-");
            nameStr.Append(endSection.Height * 100);
            nameStr.Append("x");
            nameStr.Append(startSection.WebThickness * 100);
            nameStr.Append("-");
            nameStr.Append(endSection.WebThickness * 100);

            nameStr.Append("/");
            nameStr.Append(startSection.TopFlangeWidth * 100);
            nameStr.Append("x");
            nameStr.Append(startSection.TopFlangeThickness * 100);
            nameStr.Append("/");
            nameStr.Append(startSection.BotFlangeWidth * 100);
            nameStr.Append("x");
            nameStr.Append(startSection.BotFlangeThickness * 100);
            if (startSection == null || endSection == null)
            {
                return(null);
            }
            return(new SAPITaperedSection(nameStr.ToString(), startSection, endSection, 1));
        }
Exemple #5
0
        public static bool SetISection(SAPISection Isection)
        {
            //TODO extract dimensions from shawkey's section
            string name        = Isection.Name;
            string topFlangMat = Isection.TopFlangeMaterial.MatName;
            string webMat      = Isection.WebMaterial.MatName;
            string botFlangMat = Isection.BotFlangeMaterial.MatName;

            if (Isection.TopFlangeMaterial.IsDefinedInSAP == false)
            {
                DefineCustomMaterial(Isection.TopFlangeMaterial);
            }
            if (Isection.BotFlangeMaterial.IsDefinedInSAP == false)
            {
                DefineCustomMaterial(Isection.BotFlangeMaterial);
            }
            if (Isection.WebMaterial.IsDefinedInSAP == false)
            {
                DefineCustomMaterial(Isection.WebMaterial);
            }
            int flag = mySapModel.PropFrame.SetHybridISection(name, topFlangMat, webMat, botFlangMat, Isection.Height, Isection.TopFlangeWidth,
                                                              Isection.TopFlangeThickness, Isection.WebThickness, Isection.BotFlangeWidth, Isection.BotFlangeThickness);

            if (flag != 0)
            {
                Isection.IsDefinedInSAP = false;
                return(false);
            }
            Isection.IsDefinedInSAP = true;
            return(true);
        }
 public SAPITaperedSection(string name, SAPISection startSection, SAPISection endSection, double length, LengthTypeEnum lengthType = LengthTypeEnum.Relative)
 {
     LengthType   = lengthType;
     Name         = name;
     StartSection = startSection;
     EndSection   = endSection;
     Length       = length;
 }
        public override SAPSection GetAssumedSection()
        {
            SAPISection startSection = (SAPISection)StartSection.GetAssumedSection();
            //SAPISection endSection = SAPISection.GetAssumedEndTaperSection(StartSection);
            SAPISection endSection;

            if (Math.Abs(EndSection.Height - startSection.Height) <= 40)
            {
                endSection = (SAPISection)EndSection.GetAssumedSection();
                endSection = (SAPISection)endSection.GetAssumedSection();
            }
            else
            {
                endSection = EndSection;
            }

            StringBuilder nameStr = new StringBuilder();

            nameStr.Append("I ");
            nameStr.Append(startSection.Height * 100);
            nameStr.Append("-");
            nameStr.Append(endSection.Height * 100);
            nameStr.Append("x");
            nameStr.Append(startSection.WebThickness * 100);
            nameStr.Append("-");
            nameStr.Append(endSection.WebThickness * 100);

            nameStr.Append("/");
            nameStr.Append(startSection.TopFlangeWidth * 100);
            nameStr.Append("x");
            nameStr.Append(startSection.TopFlangeThickness * 100);
            nameStr.Append("/");
            nameStr.Append(startSection.BotFlangeWidth * 100);
            nameStr.Append("x");
            nameStr.Append(startSection.BotFlangeThickness * 100);
            if (startSection == null)
            {
                return(null);
            }
            else if (endSection == null)
            {
                endSection = startSection;
            }
            return(new SAPITaperedSection(nameStr.ToString(), startSection, endSection, 1));
        }
Exemple #8
0
        public static SAPSection GetSection(SAPSection section)
        {
            if (section is SAPISection)
            {
                SAPISection temp = (SAPISection)section;
                temp    = GetISection(temp);
                section = temp;
            }
            else if (section is SAPITaperedSection)
            {
                SAPITaperedSection temp = (SAPITaperedSection)section;
                temp    = GetITaperedSection(temp);
                section = temp;
            }

            //TODO else if another section .. etc
            return(section);
        }
Exemple #9
0
        public SAPISection ConvertFromHndzIProfile(HndzISectionProfile Isection, HndzStructuralMaterial material)
        {
            SAPISection sapISection = new SAPISection();

            sapISection.Name               = Isection.Name;
            sapISection.BotFlangeWidth     = Isection.I_Section.b_fBot;
            sapISection.BotFlangeThickness = Isection.I_Section.t_fBot;
            sapISection.TopFlangeWidth     = Isection.I_Section.b_fTop;
            sapISection.TopFlangeThickness = Isection.I_Section.t_fTop;
            sapISection.WebThickness       = Isection.I_Section.t_w;

            sapISection.Height = Isection.I_Section.d;


            sapISection.BotFlangeMaterial.ConvertFromHndzMaterial(material);
            sapISection.WebMaterial.ConvertFromHndzMaterial(material);
            sapISection.TopFlangeMaterial.ConvertFromHndzMaterial(material);
            return(sapISection);
        }
Exemple #10
0
        public static SAPISection GetISection(SAPISection section)
        {
            string MatPropTopFlange = string.Empty;
            string MatPropWeb       = string.Empty;
            string MatPropBotFlange = string.Empty;
            double T3    = 0;
            double T2    = 0;
            double Tf    = 0;
            double Tw    = 0;
            double T2b   = 0;
            double Tfb   = 0;
            int    Color = 0;
            string Notes = string.Empty;
            string GUID  = string.Empty;
            int    flag  = mySapModel.PropFrame.GetHybridISection(section.Name, ref MatPropTopFlange, ref MatPropWeb, ref MatPropBotFlange, ref T3, ref T2, ref Tf, ref Tw, ref T2b, ref Tfb, ref Color, ref Notes, ref GUID);

            if (flag != 0)
            {
                return(null);
            }
            else
            {
                section.TopFlangeMaterial.MatName = MatPropBotFlange;
                section.WebMaterial.MatName       = MatPropWeb;
                section.BotFlangeMaterial.MatName = MatPropBotFlange;

                section.TopFlangeWidth     = T2;
                section.TopFlangeThickness = Tf;

                section.BotFlangeWidth     = T2b;
                section.BotFlangeThickness = Tfb;

                section.WebThickness   = Tw;
                section.IsDefinedInSAP = true;
            }
            return(section);
        }
Exemple #11
0
        private static SAPSection GetSectionByElement(string elementName)
        {
            //TODO : THIS FUNCTION IS TERRIBLE, REWRITE IT AGIAN
            SAPSection section = null;
            int        flag;
            string     propName = string.Empty;
            string     SAlist   = string.Empty;

            flag = mySapModel.FrameObj.GetSection(elementName, ref propName, ref SAlist);
            if (flag != 0)
            {
                return(null);
            }
            else
            {
                //Try to get this section as if it was a tapered section
                SAPITaperedSection tSec = new SAPITaperedSection();
                tSec.Name = propName;
                tSec      = GetITaperedSection(tSec);
                section   = tSec;
                if (tSec == null)
                {
                    //It's not tapered then it's I built up section
                    SAPISection sec = new SAPISection();
                    sec.Name = propName;
                    sec      = GetISection(sec);
                    section  = sec;
                }
                if (section == null)
                {
                    section                = new SAPITaperedSection();
                    section.Name           = propName;
                    section.IsDefinedInSAP = true;
                }
            }
            return(section);
        }
Exemple #12
0
 public SAPFrameElement()
 {
     StartPoint = new SAPPoint();
     EndPoint   = new SAPPoint();
     Section    = new SAPISection(); //TODO : This is temporary to prevent null exceptions
 }
Exemple #13
0
        public void ConvertFromHndzElement(HndzExtrudedElement element, HndzSectionTypeEnum type)
        {
            switch (type)
            {
            case HndzSectionTypeEnum.HotRolledC:
                throw new NotImplementedException("HotRolled is not ready");
                break;

            case HndzSectionTypeEnum.HotRolledI:
                throw new NotImplementedException("HotRolled is not ready");
                break;

            case HndzSectionTypeEnum.BuiltUpI:
                HndzBeamStandardCase   beam   = null;
                HndzColumnStandardCase column = null;
                if (element is HndzBeamStandardCase)
                {
                    beam = (HndzBeamStandardCase)element;
                    Name = Label = beam.Name;

                    SAPISection iSection = new SAPISection();
                    Section = iSection.ConvertFromHndzIProfile((HndzISectionProfile)beam.Profile, (HndzStructuralMaterial)beam.Material);
                    Section = iSection;

                    StartPoint.ConvertFromHndzNode(beam.ExtrusionLine.baseNode);
                    EndPoint.ConvertFromHndzNode(beam.ExtrusionLine.EndNode);
                }
                else if (element is HndzColumnStandardCase)
                {
                    column = (HndzColumnStandardCase)element;

                    Name = Label = column.Name;

                    SAPISection iSection = new SAPISection();
                    Section = iSection.ConvertFromHndzIProfile((HndzISectionProfile)column.Profile, (HndzStructuralMaterial)column.Material);
                    Section = iSection;

                    StartPoint.ConvertFromHndzNode(column.ExtrusionLine.baseNode);
                    EndPoint.ConvertFromHndzNode(column.ExtrusionLine.EndNode);
                }

                break;

            case HndzSectionTypeEnum.TaperedI:
                HndzBeamStandardCase beamTapered   = null;
                HndzBeamStandardCase columnTapered = null;
                if (element is HndzBeamStandardCase)
                {
                    //beamTapered = (HndzBeamTapered)element;
                    //Name = Label = beamTapered.Name;

                    //SAPITaperedSection iSection = new SAPITaperedSection();
                    //iSection.ConvertFromHndzTaperedI(beamTapered.Profile, (HndzStructuralMaterial)beamTapered.Material);
                    //Section = iSection;

                    //StartPoint.ConvertFromHndzNode(beamTapered.ExtrusionLine.baseNode);
                    //EndPoint.ConvertFromHndzNode(beamTapered.ExtrusionLine.EndNode);
                    throw new NotImplementedException();
                }
                else if (element is HndzBeamStandardCase)
                {
                    columnTapered = (HndzBeamStandardCase)element;
                    Name          = Label = columnTapered.Name;

                    if (columnTapered.Profile is HndzITaperedProfile)
                    {
                        HndzITaperedProfile columnTaperedProfile = columnTapered.Profile as HndzITaperedProfile;
                        SAPITaperedSection  iSection             = new SAPITaperedSection();
                        iSection.ConvertFromHndzTaperedI(columnTaperedProfile, (HndzStructuralMaterial)columnTapered.Material);
                        Section = iSection;

                        StartPoint.ConvertFromHndzNode(columnTapered.ExtrusionLine.baseNode);
                        EndPoint.ConvertFromHndzNode(columnTapered.ExtrusionLine.EndNode);
                    }
                }
                break;

            default:
                break;
            }
        }