Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Face Class, Intersect() method problem

3 REPLIES 3
Reply
Message 1 of 4
giancarlo.web
1150 Views, 3 Replies

Face Class, Intersect() method problem

I have two objects not touching or intersecting each other.

 

After extracting every face from each object and iterating through the collection i get unexpected result:

 

faceElement1[a].Intersect(faceElement2[b]) gives Intersecting as result

 

How can this be possible?

3 REPLIES 3
Message 2 of 4
RPTHOMAS108
in reply to: giancarlo.web

Is it instance geometry or symbol geometry?

 

Presumably you have two face collections one for each element and are comparing each item from one against each item from the other?

Message 3 of 4
giancarlo.web
in reply to: RPTHOMAS108

i have 2 walls, and each face collection reports correctly 6 faces

 

this is my workflow for collecting faces: 

 

 

                    GeometryElement geometryelem1 = (GeometryElement)join[e1].GetGeometryObjectFromReference(new Reference(join[e1]));
                    //Tutti i solidi nel primo GeometryObject
                    List<Autodesk.Revit.DB.Solid> solids1 = new List<Autodesk.Revit.DB.Solid>();
                    //Tutte le facce dei Solidi del primo GeometryObject
                    List<Autodesk.Revit.DB.Face> faces1 = new List<Autodesk.Revit.DB.Face>();

                    //inserisco  i solid1 nelle liste solids1
                    foreach (var element in geometryelem1)
                    {
                        solids1.Add((Autodesk.Revit.DB.Solid) element);
                    }

                    //inserisco le FacesArray di ogni solid nella lista arrays1
                    foreach (Autodesk.Revit.DB.Solid solid1 in solids1)
                    {
                        foreach (Autodesk.Revit.DB.Face face in solid1.Faces)
                        {
                            faces1.Add(face);
                        }
                    }
Message 4 of 4
RPTHOMAS108
in reply to: giancarlo.web

Apparently faces are infinite with therefore many possible intersections beyond the range of the element itself.

 

So perhaps not the best approach for your needs.

 

In the image below the green lines are plotted using curves from the overload Face.Intersect(ByVal Face, ByRef Curve). Hard to understand at first why they all exist but once you trace along parallel to the faces you start to see all are valid.

 

WallIntersects.PNG 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community