Inventor 2016 enumerating outer edges

Inventor 2016 enumerating outer edges

klemen_zivkovic
Enthusiast Enthusiast
3,578 Views
21 Replies
Message 1 of 22

Inventor 2016 enumerating outer edges

klemen_zivkovic
Enthusiast
Enthusiast

Hello guys,

 

I want to get only outer edges of pipe on picture. I am using attached VBA code to do that.

Does somebody know how can I diferentiate if edge is member of outer surface of pipe and not inner surface of pipe.

 

I will be thankfull for any idea.

 

I am running Inventor 2016.

 

regards,

0 Likes
Accepted solutions (1)
3,579 Views
21 Replies
Replies (21)
Message 2 of 22

ChrisMitchell01
Community Manager
Community Manager

Klemen,

 

You should probably repost this in the Customization forum where it's more likely to get a response:

 

http://forums.autodesk.com/t5/inventor-customization/bd-p/120

 

Thanks

Chris



Chris Mitchell
PDMS Customer Engagment Team
Autodesk, Inc.

0 Likes
Message 3 of 22

klemen_zivkovic
Enthusiast
Enthusiast

Is here nobody who is able to understand my question? I know it is hard to get definition of outer pipe edge - but still any idea though?

0 Likes
Message 4 of 22

adam.nagy
Autodesk Support
Autodesk Support

Hi Klemen,

 

You can get the edges through the Face.EdgeLoops, where each EdgeLoop knows if it's an outer edge collection or inner, shown by the IsOuterEdgeLoop property.

E.g.: http://forums.autodesk.com/t5/inventor-customization/flat-pattern-area/td-p/2689722

 

I hope this helps.

 

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 5 of 22

klemen_zivkovic
Enthusiast
Enthusiast

I am trying to understand property "IsOuterEdgeLoop". Is this property only available in sheet metal parts?

 

I see sample code and it is used within flatpattern.

Dim oEdgeLoop As EdgeLoop
    For Each oEdgeLoop In oFlatPattern.TopFace.EdgeLoops
        If oEdgeLoop.IsOuterEdgeLoop Then
            Exit For
        End If
    Next

 

 

 

The thing here is (in my specific situation) - that I have pipe, created from ordinary extrusion - and I don't have FlatPattern to work with.

What is out or in is pretty hard to decide for ordinary extrusion - is there a way to do that?

Is there a clever way to do that programatically?

 

pipePicture.png

 

0 Likes
Message 6 of 22

adam.nagy
Autodesk Support
Autodesk Support

No. All faces have the EdgeLoops collection with the IsOuterEdgeLoop property.

So you just have to iterate through all the faces of the solid body, then all the EdgeLoops to find all the outer edges on all the faces.



Adam Nagy
Autodesk Platform Services
0 Likes
Message 7 of 22

adam.nagy
Autodesk Support
Autodesk Support

Actually, it might not be that easy, but that should be a step in the right direction.

 

I also started wondering that maybe we mean different things by outer edges.

Maybe you could highlight all the edges (by selecting them in the UI) to show which edges you want to get back?

 

ExternalEdges.png

I'm also wondering why exactly you need them.



Adam Nagy
Autodesk Platform Services
0 Likes
Message 8 of 22

klemen_zivkovic
Enthusiast
Enthusiast

Hi Adam,

 

Big thanks for fast and prompt response.

I need edge coordinates to use their 3d coordinates to guide CNC plasma pipe cutting machine.

 

I am attaching picture to show what I think that outer edges are.

outerEdgesMarked.png

 

You can see my G+ album to check java code for rotating "pipe" gotten from inventor coordinates.

The coordinates are also from "inner" edges that I don't want to use for guiding plasma CNC.

https://plus.google.com/u/0/photos/110230689089207649183/albums/6056408207656893201

 

Especially check video:

https://plus.google.com/u/0/photos/+KlemenZhivko/albums/6056408207656893201/6088317570902100226?pid=...

and

sample of plasma cutting in action from youtube:

https://youtu.be/QoF1nxKW0vw?t=51

 

The edges that are important for cutting (since I don't want to take account for bevel cutting) are edges that are on outer surface of pipe.

 

regards!

0 Likes
Message 9 of 22

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

What things are always the same about the models? Are the faces you need always tangentially connected?

Knowing these things might make it easier to get what you want.

 

This is what I have so far. In this case you still need to find one of the outer faces:

http://adndevblog.typepad.com/manufacturing/2015/05/outer-edges-of-tangentially-connected-faces.html 



Adam Nagy
Autodesk Platform Services
Message 10 of 22

klemen_zivkovic
Enthusiast
Enthusiast

Adam,

 

I havent even imagined, this superb level of service.

The results of your code is almost perfect - you will see that edges on outer shell that result from holes in part are not selected, but as linear edges they also must be cutted with plasma cutter.

Is there a way to select them also?

 

Thank you very much for fast response and anticipation how to solve this!

 

result.png

0 Likes
Message 11 of 22

klemen_zivkovic
Enthusiast
Enthusiast

Also macro you posted has problem selecting straight lines. I am attaching part file for this "pipe". - see picture:

AnotherSample.png

 

 

0 Likes
Message 12 of 22

adam.nagy
Autodesk Support
Autodesk Support

Only you know what exactly needs to be selected. 🙂 You have to try to put it into an algorithm. 

 

So it seems it's not only outer edges of the face you want to select but also ones around holes.

Which holes do not need to be selected? Only the circular ones?



Adam Nagy
Autodesk Platform Services
0 Likes
Message 13 of 22

klemen_zivkovic
Enthusiast
Enthusiast

Actually all circles on outer shell of pipe from holes NEEDS to be selected. and also all edges from extrusions from Extrude feature like triangle for example. The edges that are not to be selected are edges from pipe itselve - for example round edges in direction longitudinal of pipe - that are part of pipe itself (this edges don't need to be cutted).

I think I know what mislead you - and I am sorry for that - I should also mark circle from hole... Here is another sample to better clarify myselve.

 

desiredSelection.png

0 Likes
Message 14 of 22

adam.nagy
Autodesk Support
Autodesk Support

In that case you just have to remove the IsOuterEdgeLoop check and can use directly the Edges collection.

So just had to modify this function:

' Check all edges, but ignore common
' edges with other faces
Sub GetOuterEdgesOfFaces( _
faces As ObjectCollection, edges As ObjectCollection)
  Dim f As Face
  For Each f In faces
    Dim e As Edge
    For Each e In f.edges
      Dim f2 As Face
      For Each f2 In e.faces
        If (Not f Is f2) And _
           (Not IsInCollection(f2, faces)) And _
           (Not IsInCollection(e, edges)) Then
          Call edges.Add(e)
        End If
      Next
    Next
  Next
End Sub


Adam Nagy
Autodesk Platform Services
0 Likes
Message 15 of 22

klemen_zivkovic
Enthusiast
Enthusiast

I hope I found solution (for now it works for me) - and basically I am checking feature names of edges. If they are different it means they are not part of same feature therefore they are my real edges.

"False" - "pipe" edges have both feature names same and therefore should not be selected...

 

‭itWorks.png

 

I added following to your macro:

For Each e In f.edges
If Not IsInCollection(e, edges) Then
Debug.Print e.faces.Item(1).CreatedByFeature.Name
Debug.Print e.faces.Item(2).CreatedByFeature.Name
If e.faces.Item(1).CreatedByFeature.Name <> e.faces.Item(2).CreatedByFeature.Name Then
Call edges.Add(e)
End If
End If
Next e

Thank you for support...

 

 

0 Likes
Message 16 of 22

klemen_zivkovic
Enthusiast
Enthusiast

Just thinking further for my final goal - do you think it would be possible to unroll 3d lines that I got from polygon of edge, to get flat pattern?

0 Likes
Message 17 of 22

klemen_zivkovic
Enthusiast
Enthusiast

Here is simulation of plasma cuting.

 

0 Likes
Message 18 of 22

adam.nagy
Autodesk Support
Autodesk Support

You could build up your part as a sheetmetal:

sheetmetal1.png

 

Then you can unfold the whole thing:

sheetmetal2.png

 

Part is attached.



Adam Nagy
Autodesk Platform Services
0 Likes
Message 19 of 22

klemen_zivkovic
Enthusiast
Enthusiast

Hi Adam,

 

that you for idea but I think this aproach will require few more manual steps that I want to avoid. Also my personal feelig is that metal sheet design induce some limitation from start, and one is more flexible designing orinary part.

Also I want to have as much as possible automated solution.

With few tweaks of Java code, program works pretty ok for now - and currently (still as animation on computer), it looks there are no problems with it.

It could be different story when I will put it in practice, but this is still to come and we will see this later.

 

If you want to check here is video of program in action.

https://plus.google.com/u/0/photos/110230689089207649183/albums/6056408207656893201/6154029044215086...

 

regards

0 Likes
Message 20 of 22

klemen_zivkovic
Enthusiast
Enthusiast

Hi Adam,

 

your solution works brilliantly for square and rectangular pipes but for circular ones it doesn't - it enumerates precisely 0 edges.

 

For example pipe like this:

roundPipe.png

 

Could there be also solution for circular pipe not only rectangular or square?

 

ps: check usage of your wonderful Inventor algorithm in:

https://github.com/zhivko/PipeCutter

 

regards

0 Likes