Example #1
0
        public static bool AddFrameElement(HndzExtrudedElement element, HndzSectionTypeEnum type)
        {
            SAPFrameElement sapElement = new SAPFrameElement();

            sapElement.ConvertFromHndzElement(element, type);
            return(SAP2000API.AddFrameElement(sapElement));
        }
Example #2
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;
            }
        }