A beam (Structural Framing) with no Faces ?

A beam (Structural Framing) with no Faces ?

Anonymous
Not applicable
1,138 Views
4 Replies
Message 1 of 5

A beam (Structural Framing) with no Faces ?

Anonymous
Not applicable

Hi !

Working on intersections between structural elements and ducts, I encounter an unexpected problem: A family of beam (homemade I guess) which has no Faces. I compare settings of the family with other homemade beams but found no differences... 


My method to extract Faces of elements : 

public List<Face> FindElementFace(Element Elem)
        {
            List<Face> normalFaces = new List<Face>();

            Options opt = new Options();
            opt.ComputeReferences = true;
            opt.DetailLevel = ViewDetailLevel.Fine;

            GeometryElement e = Elem.get_Geometry(opt);

            foreach (GeometryObject obj in e)
            {
                Solid solid = obj as Solid;

                if (solid != null && solid.Faces.Size > 0)
                {


                    foreach (Face face in solid.Faces)
                    {

                        PlanarFace pf = face as PlanarFace;
                        if (pf != null)
                        {
                            normalFaces.Add(pf);
                        }

                    }
                }
            }
            return normalFaces;
        }

Thank you Mustafa.Salaheldin for the method !

And my Family is Attached!

I think the original project (where i took the family) was on Revit 2015 (automatically update to 2016) and i'm working with Revit 2016. 

Any hints are welcome!
Thanks

0 Likes
1,139 Views
4 Replies
Replies (4)
Message 2 of 5

Mustafa.Salaheldin
Advisor
Advisor

Please try this

 

        public List<Face> FindElementFace(Element Elem)
        {
            List<Face> normalFaces = new List<Face>();

            Options opt = new Options();
            opt.ComputeReferences = true;
            opt.DetailLevel = ViewDetailLevel.Fine;

            GeometryElement geome = Elem.get_Geometry(opt);

            // Examine all geometry primitives of the column
            foreach (GeometryObject geomo in geome)
            {

                // Skip objects that are not geometry instances
                GeometryInstance gInstance = geomo as GeometryInstance;

                if (gInstance == null)
                {
                    continue;
                }

                // Retrieve geometry of each found geometry instance
                GeometryElement instGeometry = gInstance.GetInstanceGeometry();

                foreach (GeometryObject geobj in instGeometry)
                {
                    Solid solid = geobj as Solid;

                    if (solid != null && solid.Faces.Size > 0)
                    {
                        foreach (Face face in solid.Faces)
                        {
                            PlanarFace pf = face as PlanarFace;
                            if (pf != null)
                            {
                                normalFaces.Add(pf);
                            }
                        }
                    }
                }
            }

            return normalFaces;
        }

 


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

0 Likes
Message 3 of 5

Anonymous
Not applicable

Thank you for the quick reply !

Unfortunatly I found the same amount of faces with your method ! The beam still does not have Faces

0 Likes
Message 4 of 5

Anonymous
Not applicable

is it fully enclosed within another element of the same material with join geometry applied? I've found slabs without faces before and this turned out to be the problem.

0 Likes
Message 5 of 5

Anonymous
Not applicable

I'm using a small test project so I have no join geometries, switching element material looks pointless as well. However if I add another of my working beam to the project, it will be Faces less... 
Anyway I think we are closer to the solution! Thanks!

0 Likes