Structural Material Name

Structural Material Name

Tripler123
Advocate Advocate
573 Views
2 Replies
Message 1 of 3

Structural Material Name

Tripler123
Advocate
Advocate

Hello everyone,

 

I would like to know if there is a way to get the name of the structural material of walls or Floors.

 

Captura.PNGCaptursa.PNG

0 Likes
574 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk

That's a weird question, because your screen snapshot of RevitLookup clearly shows that the answer is YES.



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 3

Tripler123
Advocate
Advocate

 

    public static List<string> MaterialInfo(String elemento)
        {
            List<string> DataCbm = new List<string>();
            List<Element> Materiales = new List<Element>();

            List<string> strs1;

            foreach (Element el in lstElement)
            {
                if (Util.ParameterToString(el.LookupParameter("Elemento")) == elemento)
                {
                    ICollection<ElementId> materialIds = el.GetMaterialIds(false);
                    strs1 = new List<string>();
                    strs1.Clear();
                    foreach (ElementId materialId in materialIds)
                    {
                        //Materiales.Add(docGeneral.GetElement(materialId));

                        strs1.Add(docGeneral.GetElement(materialId).Name);
                        DataCbm.Add(strs1[0]);
                    }
                }
            }

            var query = from item in DataCbm
                        let palabra = item
                        group item by palabra into g
                        select new { Key = g.Key, Values = g };

            List<string> lista = new List<string>();

            foreach (var item in query)
            {
                lista.Add(item.Key);
            }
            return lista;
        }

Thanks for your reply yeremy.

I have tried to implement this code where I get the list of materials used in selected items. But it is very bad as I try luck. Some advice to get directly the name of the structural material that an element uses. One method would be helpful.

Thank you,

 

0 Likes