Exemplo n.º 1
0
        /// </structural_toolkit_2015>

        /// <summary>
        /// Creates new instance of user class wich represents a section of a structure element.
        /// </summary>
        /// <param name="sectionDataBase">Instance of base class for the section.</param>
        /// <returns>New instance of user implementation of section class derived from cref="SectionDataBase".</returns>
        public SectionDataBase CreateSectionData(SectionDataBase sectionDataBase)
        {
            switch (sectionDataBase.Material)
            {
            case StructuralAssetClass.Concrete:
                switch (sectionDataBase.Category)
                {
                default:
                    break;

                case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
                    return(new ColumnSection(sectionDataBase));

                case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
                    return(new BeamSection(sectionDataBase));

                /// <structural_toolkit_2015>
                case Autodesk.Revit.DB.BuiltInCategory.OST_FloorAnalytical:
                    return(new FloorSection(sectionDataBase));

                case Autodesk.Revit.DB.BuiltInCategory.OST_FoundationSlabAnalytical:
                    return(new FloorSection(sectionDataBase));

                case Autodesk.Revit.DB.BuiltInCategory.OST_WallAnalytical:
                    return(new WallSection(sectionDataBase));
                    /// </structural_toolkit_2015>
                }
                break;

            case StructuralAssetClass.Metal:
                break;
            }

            return(sectionDataBase);
        }
Exemplo n.º 2
0
    public ChangebleElement[] GetChangebleElementWithId(SectionDataBase id)
    {
        ChangebleElement[] retorno = null;
        foreach (var m in tBases)
        {
            if (m.id == id)
            {
                retorno = m.dataBase;
            }
        }

        foreach (var n in mBases)
        {
            if (n.id == id)
            {
                retorno = n.dataBase;
            }
        }


        foreach (var p in cBases)
        {
            if (p.id == id)
            {
                retorno = p.dataBase;
            }
        }

        return(retorno);
    }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of user's section object of linear element.
 /// </summary>
 /// <param name="sectionDataBase">Instance of base section object with predefined parameters to copy.</param>
 public LinearSection(SectionDataBase sectionDataBase)
     : base(sectionDataBase)
 {
     DesignWarning = new List <string>();
     DesignInfo    = new List <string>();
     DesignError   = new List <string>();
 }
Exemplo n.º 4
0
    public static DatesForCam GetDates(SectionDataBase sdb)
    {
        SetOfSectionDB sosDb = GetDataBaseCamSet(sdb);

        return(sosDb switch
        {
            SetOfSectionDB.cabeca => new DatesForCam()
            {
                distance = .8f, height = .7f
            },
            SetOfSectionDB.tronco => new DatesForCam()
            {
                distance = 1.5f, height = .32f
            },
            SetOfSectionDB.membros => new DatesForCam()
            {
                distance = 1.5f, height = -0.27f
            },
            SetOfSectionDB.allView => new DatesForCam()
            {
                distance = 1.8f, height = 0f
            },
            _ => new DatesForCam()
            {
                distance = .8f, height = .7f
            }
        });
Exemplo n.º 5
0
    private void ChangeAction(int change, int index)
    {
        EditableElements target = activeEditables[index];

        if (target.type == EditableType.control)
        {
            if (change != 0)
            {
                SectionDataBase     sdb  = sdbc.GetChangebleElementWithId(target.member)[target.outIndex].subsection[target.inIndex];
                FlagSectionDataBase flag = StringForEnum.GetEnum <FlagSectionDataBase>(sdb.ToString());

                if (change > 0 && !menusAtivos.HasFlag(flag))
                {
                    menusAtivos |= flag;
                }
                else if (change < 0 && menusAtivos.HasFlag(flag))
                {
                    menusAtivos &= ~flag;
                }

                RestartMenu(target);
            }
        }
        else if (target.type == EditableType.mesh || target.type == EditableType.texture)
        {
            if (change != 0)
            {
                ChangeElementMainAction(target, change);
            }
        }
    }
Exemplo n.º 6
0
    void EscapeAction(int index)
    {
        EditableElements target = activeEditables[index];

        if (target.type != EditableType.control && target.member != SectionDataBase.@base)
        {
            FlagSectionDataBase flag = StringForEnum.GetEnum <FlagSectionDataBase>(target.member.ToString());
            if (menusAtivos.HasFlag(flag))
            {
                menusAtivos &= ~flag;

                RestartMenu(GetEditableElementBySdb(target.member));
            }
        }
        else if (target.type == EditableType.control)
        {
            SectionDataBase     sdb  = sdbc.GetChangebleElementWithId(target.member)[target.outIndex].subsection[target.inIndex];
            FlagSectionDataBase flag = StringForEnum.GetEnum <FlagSectionDataBase>(sdb.ToString());
            if (menusAtivos.HasFlag(flag))
            {
                menusAtivos &= ~flag;

                RestartMenu(target);
            }
            else if (target.member != SectionDataBase.@base)
            {
                EscapeAction(index - 1);
            }
        }
    }
 public SerializableColorAssignements(ColorAssignements colorAss)
 {
     id             = colorAss.id;
     coresEditaveis = new SerializableColorContainerStruct[colorAss.coresEditaveis.Length];
     for (int i = 0; i < colorAss.coresEditaveis.Length; i++)
     {
         coresEditaveis[i] = new SerializableColorContainerStruct(colorAss.coresEditaveis[i]);
     }
 }
Exemplo n.º 8
0
        public FloorSection(SectionDataBase sectionDataBase) : base(sectionDataBase)
        {
            Width    = 0.0;
            Height   = 0.0;
            Geometry = new Geometry();

            ListInternalForces = new List <InternalForcesBase>();
            MinStiffnes[DD.X]  = MinStiffnes[DD.Y] = 0.0;
        }
Exemplo n.º 9
0
        /// <summary>
        /// Initializes a new instance of user's section object of column element.
        /// </summary>
        /// <param name="sectionDataBase">Instance of base section object with predefined parameters to copy.</param>
        public ColumnSection(SectionDataBase sectionDataBase)
            : base(sectionDataBase)
        {
            Width    = 0.0;
            Height   = 0.0;
            Geometry = new Geometry();

            ListInternalForces = new List <InternalForcesBase>();
            MinStiffness       = 0.0;
        }
Exemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of user's section object of beam element.
        /// </summary>
        /// <param name="sectionDataBase">Instance of base section object with predefined parameters to copy.</param>
        public BeamSection(SectionDataBase sectionDataBase)
            : base(sectionDataBase)
        {
            Width      = 0.0;
            Height     = 0.0;
            Geometry   = new Geometry();
            IsTSection = false;

            ListInternalForces = new List <InternalForcesBase>();
            MinStiffness       = 0.0;
        }
Exemplo n.º 11
0
        internal override bool Merge(SectionDataBase data)
        {
            var dataAsT = data as T;

            if (dataAsT != null)
            {
                Merge(dataAsT);
                return(true);
            }
            return(false);
        }
Exemplo n.º 12
0
    void GetSimpleChangebleElements(ContadorAtual cAtual, out SimpleChangebleMesh sm, out GameObject gg)
    {
        int             cont = guardCont[cAtual];
        SectionDataBase sdb  = StringParaEnum.ObterEnum(cAtual.ToString(), SectionDataBase.nariz);

        SimpleChangebleMesh[] sms = S.GetDbMeshWithId(sdb);

        gg = partes_b[cont].atual;
        int indexOfsm = partes_b[cont].contador;

        sm = sms[indexOfsm];
    }
Exemplo n.º 13
0
    void GetCombinedChangebleElements(ContadorAtual cAtual, out CombinedChangebleMesh sm, out GameObject gg)
    {
        int             cont = guardCont[cAtual];
        SectionDataBase sdb  = StringParaEnum.ObterEnum(cAtual.ToString(), SectionDataBase.nariz);

        CombinedChangebleMesh[] sms = S.GetCombinedMeshDbWithID(sdb);

        gg = partesComTamanho_b[cont].atual;
        int indexOfsm = partesComTamanho_b[cont].contador;

        sm = sms[indexOfsm];
    }
Exemplo n.º 14
0
    public static TextureContainer SelectTexByID(TextureContainer[] tc, SectionDataBase sdb)
    {
        for (int i = 0; i < tc.Length; i++)
        {
            if (tc[i].id == sdb)
            {
                return(tc[i]);
            }
        }

        Debug.Log("TextureContainerElementTools não encontrou o indece: " + sdb);
        return(null);
    }
Exemplo n.º 15
0
    void TrocaMesh(int change)
    {
        SectionDataBase meuDb = StringParaEnum.ObterEnum(cAtual.ToString(), SectionDataBase.cabelo);

        SimpleChangebleMesh[] m = S.GetDbMeshWithId(meuDb);

        int index = guardCont[cAtual];

        Color[] C = GuardColor(partes_b[index].atual, m[partes_b[index].contador].coresEditaveis);
        partes_b[index].contador = ContadorCiclico.Contar(change, partes_b[index].contador, m.Length);
        MudarMesh(ref partes_b[index].atual, m[partes_b[index].contador].mesh);
        SetRememberedColors(C, m[partes_b[index].contador].coresEditaveis, partes_b[index].atual);
    }
Exemplo n.º 16
0
    EditableElements GetEditableElementBySdb(SectionDataBase sdb)
    {
        EditableElements retorno = new EditableElements();

        for (int i = 0; i < activeEditables.Length; i++)
        {
            if (activeEditables[i].mySDB == sdb && activeEditables[i].type == EditableType.control)
            {
                retorno = activeEditables[i];
            }
        }

        return(retorno);
    }
Exemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of user's section object of linear element.
 /// </summary>
 /// <param name="sectionDataBase">Instance of base section object with predefined parameters to copy.</param>
 public SurfaceSection(SectionDataBase sectionDataBase)
     : base(sectionDataBase)
 {
     DesignWarning = new Dictionary <DD, List <string> >()
     {
         { DD.X, new List <string>() }, { DD.Y, new List <string>() }
     };
     DesignInfo = new Dictionary <DD, List <string> >()
     {
         { DD.X, new List <string>() }, { DD.Y, new List <string>() }
     };
     DesignError = new Dictionary <DD, List <string> >()
     {
         { DD.X, new List <string>() }, { DD.Y, new List <string>() }
     };
 }
Exemplo n.º 18
0
    void ControlMainAction(EditableElements target)
    {
        SectionDataBase     sdb  = sdbc.GetChangebleElementWithId(target.member)[target.outIndex].subsection[target.inIndex];
        FlagSectionDataBase flag = StringForEnum.GetEnum <FlagSectionDataBase>(sdb.ToString());

        if (menusAtivos.HasFlag(flag))
        {
            menusAtivos &= ~flag;
        }
        else
        {
            menusAtivos |= flag;
        }

        RestartMenu(target);
    }
Exemplo n.º 19
0
    void ChangeCombinedMesh(int change)
    {
        ConjuntoDasPartesComTamanhoCombinado_b c   = ConjuntoCombinadoPorID(cAtual);
        ConjuntoDasPartesComTamanhoCombinado_b c_2 = ConjuntoCombinadoPorID(c.combinadoCom);

        SectionDataBase meuDb = StringParaEnum.ObterEnum <SectionDataBase>(cAtual.ToString());

        CombinedChangebleMesh[] m = S.GetCombinedMeshDbWithID(meuDb);
        meuDb = StringParaEnum.ObterEnum <SectionDataBase>(c.combinadoCom.ToString());
        CombinedChangebleMesh[] m2 = S.GetCombinedMeshDbWithID(meuDb);

        c.contador = ContadorCiclico.Contar(change, c.contador, m.Length);
        Color[] guard_1 = GuardColor(c.atual, m[c.contador].coresEditaveis);
        Color[] guard_2 = GuardColor(c_2.atual, m2[c_2.contador].coresEditaveis);
        MudarMesh(ref c.atual, m[c.contador].mesh);
        MudarMesh(ref c_2.atual, GetMeshCombinedWithId(m2, m[c.contador].combinedWithId[0]));

        SetRememberedColors(guard_1, m[c.contador].coresEditaveis, c.atual);
        SetRememberedColors(guard_2, m2[c_2.contador].coresEditaveis, c_2.atual);
    }
Exemplo n.º 20
0
    public MaskedTexture[] GetMaskedTexDbWithId(SectionDataBase id)
    {
        int check = -1;

        for (int i = 0; i < tBases.Length; i++)
        {
            if (tBases[i].id == id)
            {
                check = i;
            }
        }

        if (check == -1)
        {
            return(null);
        }
        else
        {
            return(tBases[check].dataBase);
        }
    }
Exemplo n.º 21
0
    int GetInListDbIndex(List <EditableElements> L, SectionDataBase sdb)
    {
        int retorno = -1;

        for (int i = 1; i < L.Count; i++)
        {
            Debug.Log(sdbc.GetChangebleElementWithId(L[i].member) + " : " + L[i].member + " : " + L[i].type);

            ChangebleElement changeE = sdbc.GetChangebleElementWithId(L[i].member)[L[i].outIndex];

            if (changeE.subsection.Length > 0)
            {
                if (changeE.subsection[L[i].inIndex] == sdb)
                {
                    retorno = i;
                }
            }
        }

        return(retorno);
    }
Exemplo n.º 22
0
    public SimpleChangebleMesh[] GetDbMeshWithId(SectionDataBase id)
    {
        int check = -1;

        for (int i = 0; i < mBases.Length; i++)
        {
            if (mBases[i].id == id)
            {
                check = i;
            }
        }

        if (check == -1)
        {
            return(null);
        }
        else
        {
            return(mBases[check].dataBase);
        }
    }
Exemplo n.º 23
0
    public CombinedChangebleMesh[] GetCombinedMeshDbWithID(SectionDataBase id)
    {
        int check = -1;

        for (int i = 0; i < cBases.Length; i++)
        {
            if (cBases[i].id == id)
            {
                check = i;
            }
        }

        if (check == -1)
        {
            return(null);
        }
        else
        {
            return(cBases[check].dataBase);
        }
    }
Exemplo n.º 24
0
        /// <summary>
        /// Creates new instance of user class wich represents a section of a structure element.
        /// </summary>
        /// <param name="sectionDataBase">Instance of base class for the section.</param>
        /// <returns>New instance of user implementation of section class derived from cref="SectionDataBase".</returns>
        public SectionDataBase CreateSectionData(SectionDataBase sectionDataBase)
        {
            switch (sectionDataBase.Material)
            {
            case StructuralAssetClass.Concrete:
                switch (sectionDataBase.Category)
                {
                default:
                    break;

                case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
                    return(new ColumnSection(sectionDataBase));

                case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
                    return(new BeamSection(sectionDataBase));
                }
                break;

            case StructuralAssetClass.Metal:
                break;
            }

            return(sectionDataBase);
        }
Exemplo n.º 25
0
 public TextureContainer GetTexContainerByID(SectionDataBase sdb)
 {
     return(TextureContainerElementTools.SelectTexByID(textureSign, sdb));
 }
Exemplo n.º 26
0
 internal abstract bool Merge(SectionDataBase data);
Exemplo n.º 27
0
 internal abstract bool Merge(SectionDataBase data);
Exemplo n.º 28
0
    void VerifySubSections(List <EditableElements> L, SectionDataBase target, int deep)
    {
        if (!VerifyActiveDbView(target))
        {
            return;
        }


        int dbIndex = secManager.GetActiveIndexOf(target);

        if (dbIndex == -1)
        {
            Debug.Log("Não encontrada referencia no sectionManager para : " + target);
            return;
        }

        int inListIndex = GetInListDbIndex(L, target);

        ChangebleElement changeE = sdbc.GetChangebleElementWithId(target)[dbIndex];


        List <EditableElements> forInsert = new List <EditableElements>();

        if (changeE is SimpleChangebleMesh || changeE is CombinedChangebleMesh)
        {
            forInsert.Add(new EditableElements()
            {
                mySDB       = target,
                displayName = DeepView(deep) + "Type",
                inIndex     = 0,
                outIndex    = dbIndex,
                member      = target,
                type        = EditableType.mesh
            });
        }
        else if (changeE is MaskedTexture)
        {
            forInsert.Add(new EditableElements()
            {
                mySDB       = target,
                displayName = DeepView(deep) + "Detail",
                inIndex     = 0,
                outIndex    = dbIndex,
                member      = target,
                type        = EditableType.texture
            });
        }

        int contCores = 0;

        for (int i = 0; i < changeE.coresEditaveis.Length; i++)
        {
            if (changeE.coresEditaveis[i].registro != RegistroDeCores.skin)
            {
                contCores++;
                forInsert.Add(new EditableElements()
                {
                    mySDB       = target,
                    displayName = DeepView(deep) + "Cor " + contCores,
                    inIndex     = i,
                    outIndex    = dbIndex,
                    member      = target,
                    type        = EditableType.color
                });
            }
        }

        SectionDataBase[] s = changeE.subsection;

        for (int i = 0; i < s.Length; i++)
        {
            forInsert.Add(new EditableElements()
            {
                mySDB       = s[i],
                displayName = DeepView(deep) + " " + s[i].ToString(),
                inIndex     = i,
                outIndex    = 0,
                member      = target,
                type        = EditableType.control
            });
        }

        L.InsertRange(inListIndex + 1, forInsert);



        if (s.Length > 0)
        {
            for (int i = 0; i < s.Length; i++)
            {
                VerifySubSections(L, s[i], deep + 1);
            }
        }
    }
Exemplo n.º 29
0
 bool VerifyActiveDbView(SectionDataBase sdb)
 {
     return(menusAtivos.HasFlag(StringForEnum.GetEnum <FlagSectionDataBase>(sdb.ToString())));
 }
Exemplo n.º 30
0
        /// <summary>
        /// Runs calculation\operations for cref="BeamSection" and cref="ColumnSection".
        /// </summary>
        /// <param name="obj">cref="BeamSection" object or cref="ColumnSection" object.</param>
        /// <returns>Result of calculation.</returns>
        public bool Run(ObjectDataBase obj)
        {
            SectionDataBase sectionData = obj as SectionDataBase;

            if (obj != null)
            {
                CommonParameters commParams = Parameters as CommonParameters;

                ForceResultsCache cache = null;
                if (commParams != null)
                {
                    cache = commParams.ResultCache;
                }

                Section sec = null;

                switch (sectionData.Category)
                {
                default:
                    break;

                case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
                    if (sectionData is ColumnSection)
                    {
                        ColumnSection section = sectionData as ColumnSection;

                        if (section.Info != null)
                        {
                            SectionsInfo secInfo = section.Info.Sections.AtTheBeg;

                            if (secInfo.Sections.Count > 0)
                            {
                                sec = secInfo.Sections[0];
                            }
                        }
                    }
                    break;

                case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
                    if (sectionData is BeamSection && sectionData.Label is LabelBeam)
                    {
                        BeamSection section = sectionData as BeamSection;
                        LabelBeam   label   = sectionData.Label as LabelBeam;

                        if (section.Info != null)
                        {
                            SectionsInfo secInfo = section.Info.Sections.AtTheBeg;

                            if (secInfo.Sections.Count > 0)
                            {
                                sec = secInfo.Sections[0];

                                if (label.SlabBeamInteraction == ConcreteTypes.BeamSectionType.WithSlabBeamInteraction && section.Info.Slabs != null && section.Info.Slabs.TSection != null)
                                {
                                    int    nbrPoints      = (sec.Contour != null && sec.Contour.Points != null) ? sec.Contour.Points.Count : 0;
                                    double relativeX      = (section.CalcPoint as CalcPointLinear).CoordRelative;
                                    double maxFlangeWidth = 0.5 * section.Info.SectionsParams.AtThePoint(relativeX).Dimensions.h;
                                    sec = section.Info.Slabs.TSection.GetContour(relativeX, maxFlangeWidth, maxFlangeWidth);
                                    if (sec.Contour.Points.Count != nbrPoints)
                                    {
                                        section.IsTSection = true;
                                        section.DesignInfo.Add(Resources.ResourceManager.GetString("SlabBeamInteraction"));
                                    }
                                }
                            }
                        }
                    }
                    break;
                }

                switch (sectionData.Category)
                {
                default:
                    break;

                case Autodesk.Revit.DB.BuiltInCategory.OST_ColumnAnalytical:
                case Autodesk.Revit.DB.BuiltInCategory.OST_BeamAnalytical:
                    if (sectionData is LinearSection)
                    {
                        LinearSection section = sectionData as LinearSection;

                        if (sec != null && sec.Contour != null)
                        {
                            foreach (Autodesk.Revit.DB.XYZ p in sec.Contour.Points)
                            {
                                section.Geometry.Add(p.X, p.Y);
                            }

                            Autodesk.Revit.DB.XYZ pmin = sec.GetMinimumBoundary();
                            Autodesk.Revit.DB.XYZ pmax = sec.GetMaximumBoundary();
                            section.Width  = Math.Abs(pmin.X - pmax.X);
                            section.Height = Math.Abs(pmin.Y - pmax.Y);
                        }


                        if (cache != null)
                        {
                            IList <ForceLoadCaseDescriptor> loadCaseDescriptors = cache.GetLoadCaseDescriptors();
                            List <double> vFx = cache.GetForceForPoint(sectionData.ElementId, loadCaseDescriptors, sectionData.CalcPoint, ForceType.Fx);
                            List <double> vFy = cache.GetForceForPoint(sectionData.ElementId, loadCaseDescriptors, sectionData.CalcPoint, ForceType.Fy);
                            List <double> vFz = cache.GetForceForPoint(sectionData.ElementId, loadCaseDescriptors, sectionData.CalcPoint, ForceType.Fz);
                            List <double> vMx = cache.GetForceForPoint(sectionData.ElementId, loadCaseDescriptors, sectionData.CalcPoint, ForceType.Mx);
                            List <double> vMy = cache.GetForceForPoint(sectionData.ElementId, loadCaseDescriptors, sectionData.CalcPoint, ForceType.My);
                            List <double> vMz = cache.GetForceForPoint(sectionData.ElementId, loadCaseDescriptors, sectionData.CalcPoint, ForceType.Mz);

                            List <double> vUx = cache.GetForceForPoint(sectionData.ElementId, loadCaseDescriptors, sectionData.CalcPoint, ForceType.Ux);
                            List <double> vUy = cache.GetForceForPoint(sectionData.ElementId, loadCaseDescriptors, sectionData.CalcPoint, ForceType.Uy);
                            List <double> vUz = cache.GetForceForPoint(sectionData.ElementId, loadCaseDescriptors, sectionData.CalcPoint, ForceType.Uz);

                            int i = -1;
                            foreach (ForceLoadCaseDescriptor cas in loadCaseDescriptors)
                            {
                                i++;
                                InternalForcesLinear    linForces = new InternalForcesLinear();
                                InternalForcesContainer forces    = new InternalForcesContainer();

                                forces.CaseName   = cas.Name;
                                forces.LimitState = cas.State;

                                forces.ForceFx      = vFx.Count == 0 ? 0.0 : vFx[i];
                                forces.ForceFy      = vFy.Count == 0 ? 0.0 : vFy[i];
                                forces.ForceFz      = vFz.Count == 0 ? 0.0 : vFz[i];
                                forces.MomentMx     = vMx.Count == 0 ? 0.0 : vMx[i];
                                forces.MomentMy     = vMy.Count == 0 ? 0.0 : vMy[i];
                                forces.MomentMz     = vMz.Count == 0 ? 0.0 : vMz[i];
                                forces.DeflectionUx = vUx.Count == 0 ? 0.0 : vUx[i];
                                forces.DeflectionUy = vUy.Count == 0 ? 0.0 : vUy[i];
                                forces.DeflectionUz = vUz.Count == 0 ? 0.0 : vUz[i];

                                linForces.Forces = forces;

                                section.ListInternalForces.Add(linForces);
                            }
                        }
                    }
                    break;
                }
            }
            return(true);
        }
Exemplo n.º 31
0
        /// <summary>
        /// Runs calculation\operations for cref="BeamSection" and cref="ColumnSection".
        /// </summary>
        /// <param name="obj">cref="BeamSection" object or cref="ColumnSection" object.</param>
        /// <returns>Result of calculation.</returns>
        public bool Run(ObjectDataBase obj)
        {
            bool            ret         = true;
            SectionDataBase sectionData = obj as SectionDataBase;

            if (obj != null)
            {
                Concrete.ConcreteSectionDesign design = new ConcreteSectionDesign();
                design.ElementType = sectionData.Category;

                switch (sectionData.Category)
                {
                default:
                    break;

                case BuiltInCategory.OST_ColumnAnalytical:
                case BuiltInCategory.OST_BeamAnalytical:
                    if (sectionData.Label is LabelColumn)
                    {
                        CodeCheckingConcreteExample.Main.LabelColumn label = sectionData.Label as CodeCheckingConcreteExample.Main.LabelColumn;
                        design.LongitudinalReinforcementMinimumYieldStress = label.LongitudinalReinforcement.MinimumYieldStress;
                        design.LongitudinalReinforcementArea     = label.LongitudinalReinforcement.Area;
                        design.LongitudinalReinforcementDiameter = label.LongitudinalReinforcement.BarDiameter;
                        design.LongitudinalCalculationType       = label.LongitudinalCalculationType;
                        ///
                        design.TransversalReinforcementMinimumYieldStress = label.TransversalReinforcement.MinimumYieldStress;
                        design.TransversalReinforcementArea     = label.TransversalReinforcement.Area;
                        design.TransversalReinforcementDiameter = label.TransversalReinforcement.BarDiameter;
                        design.TransversalCalculationType       = label.TransversalCalculationType;
                        design.CreepCoefficient = label.CreepCoefficient;
                    }

                    if (sectionData.Label is LabelBeam)
                    {
                        CodeCheckingConcreteExample.Main.LabelBeam label = sectionData.Label as CodeCheckingConcreteExample.Main.LabelBeam;

                        design.LongitudinalReinforcementMinimumYieldStress = label.LongitudinalReinforcement.MinimumYieldStress;
                        design.LongitudinalReinforcementArea     = label.LongitudinalReinforcement.Area;
                        design.LongitudinalReinforcementDiameter = label.LongitudinalReinforcement.BarDiameter;
                        design.LongitudinalCalculationType       = label.LongitudinalCalculationType;
                        ///
                        design.TransversalReinforcementMinimumYieldStress = label.TransversalReinforcement.MinimumYieldStress;
                        design.TransversalReinforcementArea     = label.TransversalReinforcement.Area;
                        design.TransversalReinforcementDiameter = label.TransversalReinforcement.BarDiameter;
                        design.TransversalCalculationType       = label.TransversalCalculationType;
                        design.CreepCoefficient = label.CreepCoefficient;
                    }

                    if (sectionData is LinearSection)
                    {
                        LinearSection section = sectionData as LinearSection;
                        if (section.Info != null)
                        {
                            design.CoverTop    = 0.0;
                            design.CoverBottom = 0.0;

                            if (section.Info.RebarCovers != null)
                            {
                                if (section is BeamSection)
                                {
                                    if (section.Info.RebarCovers.Exist(BuiltInParameter.CLEAR_COVER_BOTTOM))
                                    {
                                        design.CoverBottom = section.Info.RebarCovers.GetDistance(BuiltInParameter.CLEAR_COVER_BOTTOM);
                                    }
                                    if (section.Info.RebarCovers.Exist(BuiltInParameter.CLEAR_COVER_TOP))
                                    {
                                        design.CoverTop = section.Info.RebarCovers.GetDistance(BuiltInParameter.CLEAR_COVER_TOP);
                                    }
                                }
                                if (section is ColumnSection)
                                {
                                    if (section.Info.RebarCovers.Exist(BuiltInParameter.CLEAR_COVER_OTHER))
                                    {
                                        design.CoverBottom = section.Info.RebarCovers.GetDistance(BuiltInParameter.CLEAR_COVER_OTHER);
                                        design.CoverTop    = section.Info.RebarCovers.GetDistance(BuiltInParameter.CLEAR_COVER_OTHER);
                                    }
                                }
                            }

                            if (section.Info.SectionsParams == null)
                            {
                                design.Type = SectionShapeType.RectangularBar;
                            }
                            else
                            {
                                design.Type = section.Info.SectionsParams.ShapeType;
                            }
                            design.YoungModulus = section.Info.Material.Characteristics.YoungModulus.X;

                            MaterialConcreteCharacteristics concrete = (MaterialConcreteCharacteristics)section.Info.Material.Characteristics.Specific;

                            if (concrete != null)
                            {
                                design.Compression = concrete.Compression;
                            }

                            design.Geometry = section.Geometry;
                            design.Width    = section.Width;
                            design.Height   = section.Height;

                            List <InternalForcesContainer> listInternalForces = new List <InternalForcesContainer>();
                            foreach (InternalForcesLinear force in section.ListInternalForces)
                            {
                                listInternalForces.Add(force.Forces);
                            }

                            design.ListInternalForces = listInternalForces;;

                            //
                            // calculation
                            //
                            design.Calculate();

                            //
                            // save result
                            //
                            section.AsBottom           = design.AsBottom;
                            section.AsTop              = design.AsTop;
                            section.AsRight            = design.AsRight;
                            section.AsLeft             = design.AsLeft;
                            section.Spacing            = design.Spacing;
                            section.TransversalDensity = design.TransversalDensity;
                            section.MinStiffness       = design.MinStiffness;
                            section.DesignInfo.AddRange(design.DesignInfo);
                            section.DesignError.AddRange(design.DesignError);
                            section.DesignWarning.AddRange(design.DesignWarning);


                            if (section.DesignError.Count > 0)
                            {
                                ret = false;
                            }
                        }
                    }
                    break;
                }
            }
            return(ret);
        }