I would like to get a list of all tube-like surfaces between 2 selected tube-like surfaces.
1. The user selects 2 tube-like surfaces (1 and 7 as shown in attached picture)
2. The program lists these 2 tube-like surfaces and all the surfaces among these 2 tube-like surfaces (1,2,3,4,5,6,7)
Let's assume, for starters, that all the tube-like surfaces are sewn together into a single body.
Then you can use the SNAP face-edge topology functions to "walk" from one face to the next one via their shared edge.
So, suppose our current face is face1, and we got to it by stepping across edge1. Then, to get to the next face (let's call it face2), we use face1.Edges to get to the next shared edge (call it sharedEdge). And then we use sharedEdge.Faces to get to the next face. Sorry I can't provide working code ... my VS install is broken right now.
If the surfaces are not yet sewn together, then you could ask the user to sew them, first, or you have to search through the model trying to figure what's adjacent to what. This latter would be pretty messy, so I won't go into it unless you say you need it.
The Snap.Topology namespeace was new in NX10, I think, so maybe you don't have it.
But you don't need it for this exercise.
The properties we are using are:
I have it in the namespace but I tried to look for example code or how to use it in the reference guide but I could find none.
sharedEdge = face1.Edges
is okay but the
face2 = sharedEdge.Faces
is not okay. It returns
'faces' is not a member of 'Edge()'
face1.Edges is an array of edges. You have to distinguish between individual edges and arrays of edges
You can write stuff like this:
Dim allEdges As Snap.NX.Edge() = face1.Edges Dim edge0 As Snap.NX.Edge = allEdges(0) Dim twoFaces As Snap.NX.Face() = edge0.Faces Dim nextFace As Snap.NX.Face = twoFaces(0)
This is just to illustrate the syntax. You'll need a lot more logic to figure out whether you need twoFaces(0) or twoFaces(1), for example.
If I can use
would it be simplifer the code/algorithm? If you have a sample code with this, can you post it?