Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Chamfer from InnerEdgeLoop API VB.NET

6 REPLIES 6
Reply
Message 1 of 7
florian_wenzel
301 Views, 6 Replies

Chamfer from InnerEdgeLoop API VB.NET

florian_wenzel
Advocate
Advocate

Hi,

 

inventor 2022

API VB.NET Visual Studio

 

I try to Select a Face with a Slot, Take the Inside EdgeLoop, and Create a Chamfer on this Slot:

 

This is the Goal

florian_wenzel_0-1655897117015.png

 

florian_wenzel_0-1655896639726.png

 

 

 

This is my Code:

 

 

    Dim oFaceSlot As Face = g_inventorApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Pick a Face")
        Dim oEdgeloop As EdgeLoop
        Dim oEdge As Edge
        Dim oEdgeColl As EdgeCollection = oTO.CreateEdgeCollection


        For Each oEdgeloop In oFaceSlot.EdgeLoops
            If oEdgeloop.IsOuterEdgeLoop = False Then

                For Each oEdge In oEdgeloop.Edges
                    oEdgeColl.Add(oEdge)

                Next



            End If
        Next


        Dim oChamfer As ChamferFeature
        oChamfer = oPart_C_Def.Features.ChamferFeatures.AddUsingDistance(oEdgeColl, 0.5, True)

 

Error:

Unknow Error

florian_wenzel_0-1655898469963.png

 

It Works with Fillet

florian_wenzel_0-1655905188486.png

 

But i Need a Chamfer.

 

 

Thanks for Suggestion

 

0 Likes

Chamfer from InnerEdgeLoop API VB.NET

Hi,

 

inventor 2022

API VB.NET Visual Studio

 

I try to Select a Face with a Slot, Take the Inside EdgeLoop, and Create a Chamfer on this Slot:

 

This is the Goal

florian_wenzel_0-1655897117015.png

 

florian_wenzel_0-1655896639726.png

 

 

 

This is my Code:

 

 

    Dim oFaceSlot As Face = g_inventorApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Pick a Face")
        Dim oEdgeloop As EdgeLoop
        Dim oEdge As Edge
        Dim oEdgeColl As EdgeCollection = oTO.CreateEdgeCollection


        For Each oEdgeloop In oFaceSlot.EdgeLoops
            If oEdgeloop.IsOuterEdgeLoop = False Then

                For Each oEdge In oEdgeloop.Edges
                    oEdgeColl.Add(oEdge)

                Next



            End If
        Next


        Dim oChamfer As ChamferFeature
        oChamfer = oPart_C_Def.Features.ChamferFeatures.AddUsingDistance(oEdgeColl, 0.5, True)

 

Error:

Unknow Error

florian_wenzel_0-1655898469963.png

 

It Works with Fillet

florian_wenzel_0-1655905188486.png

 

But i Need a Chamfer.

 

 

Thanks for Suggestion

 

6 REPLIES 6
Message 2 of 7

Michael.Navara
Advisor
Advisor

The code looks fine and it works for me. May be the chamfer size (0.5) is too big for your test case. Dimension units in API is always in centimeters. 

0 Likes

The code looks fine and it works for me. May be the chamfer size (0.5) is too big for your test case. Dimension units in API is always in centimeters. 

Message 3 of 7

florian_wenzel
Advocate
Advocate

Hi @Michael.Navara 

 

Still unknow Error:

florian_wenzel_0-1655930464554.png

i also was trying with 0.1 or 0.05  or "0.1"

Stil Error.

 

Should i Use a Chamfer Definition?

But dont know exactly what to use it?

0 Likes

Hi @Michael.Navara 

 

Still unknow Error:

florian_wenzel_0-1655930464554.png

i also was trying with 0.1 or 0.05  or "0.1"

Stil Error.

 

Should i Use a Chamfer Definition?

But dont know exactly what to use it?

Message 4 of 7

Michael.Navara
Advisor
Advisor

This is my test case with local iLogic rule

 

0 Likes

This is my test case with local iLogic rule

 

Message 5 of 7

florian_wenzel
Advocate
Advocate

Hi @Michael.Navara ,

 

I check your iLogic Rules, and it work also with Curved Face.

florian_wenzel_0-1655972305927.png

 

 

is this Possible that i got Error, because in my Example the Face is not Planar.

This is a Curved Face, do this matter?

Maybe this is the Problem with API?

 

Is Stange, because the FilletFeature Works Fine.

I only Think, that the Feature still need some Ddefinitions?

0 Likes

Hi @Michael.Navara ,

 

I check your iLogic Rules, and it work also with Curved Face.

florian_wenzel_0-1655972305927.png

 

 

is this Possible that i got Error, because in my Example the Face is not Planar.

This is a Curved Face, do this matter?

Maybe this is the Problem with API?

 

Is Stange, because the FilletFeature Works Fine.

I only Think, that the Feature still need some Ddefinitions?

Message 6 of 7

Michael.Navara
Advisor
Advisor

Can you post your test data, where my code doesn't work?

0 Likes

Can you post your test data, where my code doesn't work?

Message 7 of 7

florian_wenzel
Advocate
Advocate

Hi,

Your iLogic Code is Working, also with Curved Face.

What you mean test data?

0 Likes

Hi,

Your iLogic Code is Working, also with Curved Face.

What you mean test data?

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

Post to forums  

Autodesk Design & Make Report