Cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain the list of all tube-like surfaces between 2 selected tube-like surfaces, VB.NET/SNAP

Valued Contributor
Valued Contributor

I would like to get a list of all tube-like surfaces between 2 selected tube-like surfaces.

 

An example:

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)

 

Capture.PNG

 

 

 

 

 

9 REPLIES

Re: How to obtain the list of all tube-like surfaces between 2 selected tube-like surfaces, VB.NET/S

Siemens Phenom Siemens Phenom
Siemens Phenom

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.

 

 

 

 

山田
yamada

Re: How to obtain the list of all tube-like surfaces between 2 selected tube-like surfaces, VB.NET/S

Valued Contributor
Valued Contributor

 @Yamada

Let's assume we are dealing with simplest case. Can you post the sample code with 

 

Snap.Topology

  

I tried to search in the reference guide but it did not show up. 

 

op - you are having problem Robot Indifferent

 

Re: How to obtain the list of all tube-like surfaces between 2 selected tube-like surfaces, VB.NET/S

Siemens Phenom Siemens Phenom
Siemens Phenom

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:

 

Snap.NX.Face.Edges

Snap.NX.Edge.Faces

 

山田
yamada

Re: How to obtain the list of all tube-like surfaces between 2 selected tube-like surfaces, VB.NET/S

Valued Contributor
Valued Contributor

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.

Re: How to obtain the list of all tube-like surfaces between 2 selected tube-like surfaces, VB.NET/S

Valued Contributor
Valued Contributor

 

sharedEdge =  face1.Edges

 is okay but the 

 

 

face2 =  sharedEdge.Faces

is not okay. It returns 

'faces' is not a member of 'Edge()'

 

 

 

Re: How to obtain the list of all tube-like surfaces between 2 selected tube-like surfaces, VB.NET/S

Siemens Phenom Siemens Phenom
Siemens Phenom

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.

 

山田
yamada

Re: How to obtain the list of all tube-like surfaces between 2 selected tube-like surfaces, VB.NET/S

Valued Contributor
Valued Contributor

If I can use

Snap.Topology

would it be simplifer the code/algorithm?  If you have a sample code with this, can you post it?

 

 

Re: How to obtain the list of all tube-like surfaces between 2 selected tube-like surfaces, VB.NET/S

Siemens Phenom Siemens Phenom
Siemens Phenom
I don't think SNAP. Topology would help much, probably not at all.

SNAP.Topology has a concept called a "loop", which is a connected string of edges. Each of your tube faces has two loops. But if the model is nice, then each of your loops will have only a single edge, so the loop concept doesn't help.

I don't have any sample code, beyond what's in the SNAP docs already.
山田
yamada

Re: How to obtain the list of all tube-like surfaces between 2 selected tube-like surfaces, VB.NET/S

Valued Contributor
Valued Contributor

Let me try and I will let follow up.