Bad Body (Error: Edge intended convexity disagrees with geometry checked)

Bad Body (Error: Edge intended convexity disagrees with geometry checked)

Maxim-CADman77
Advisor Advisor
1,598 Views
17 Replies
Message 1 of 18

Bad Body (Error: Edge intended convexity disagrees with geometry checked)

Maxim-CADman77
Advisor
Advisor

I wonder wich is the less intrusive* way to fix the "Bad Body" (revealed with BSCT, initiated with Ctrl+F7) produced by Flange3 in attached Sheet Metal part (Error: Edge intended convexity disagrees with geometry checked)?

 

* Rebuilding the element  from skratch does the trick but this solution not only changes the part topolody and adds work on assembly-level but also rises risks of error due to "human factor".

 

PS: What is a root of the issue (changed algorithms of Sheet Metal "Add-in" or soe wrong action of author)?

 

Thanks in Advance.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Accepted solutions (1)
1,599 Views
17 Replies
Replies (17)
Message 2 of 18

TheCADWhisperer
Consultant
Consultant

I did notice that your Sketch1 is not fully defined, but I am not getting any errors.

Have you installed all Updates for your version of Inventor?

 

Updates.PNG

0 Likes
Message 3 of 18

Maxim-CADman77
Advisor
Advisor

I've just installed update 8, re-saved the file and call BSCT and that Bad Body Error occured in its report again (please see the attached screenshot)

 

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 4 of 18

johnsonshiue
Community Manager
Community Manager

Hi! I think this is a bug in 2014 or older releases. I tried it on newer releases by migrating the features internally and the body checks good. I am sorry I don't have a solution to 2014.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 5 of 18

Maxim-CADman77
Advisor
Advisor

Where could i read about internal feature migration you've referenced?

If I open the fie in Inventor 2018.3, save (migrate) it and then press Ctrl+F7 I still get Bad Body and the error:

image.png

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 6 of 18

johnsonshiue
Community Manager
Community Manager

Hi! The tool is for internal debug purpose. If you want, I can try migrating the feature for you and save it in 2018. But, the file cannot be opened in prior releases.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 7 of 18

Maxim-CADman77
Advisor
Advisor

Thank you but proposed scenario is far from what I'm looking for.
I need to fix all Bad Body issues on our side in some automatic manner keeping the original release format and topology. I as CADmanager also should provide authors some recommendations regarding what they should not do in order not to produce Bad Bodies..

 

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 8 of 18

kelly.young
Autodesk Support
Autodesk Support

Hello @Maxim-CADman77 not sure what was happening before, I opened in 2015 and could see the 1 bad body.

 

If you delete and add back on with same inputs the body is happy again.

 

The only way I could find without deleting the Flange would be to:

  • Edit Flange3 > Width Extents > Type > Edge

FlangeEdge.png

  • Sheet Metal > Modify > Corner Seam

CornerSeam.png

 

Not sure why the bodies are bad, but that should get you going without deleting anything. Hope that helps!

 

Please select the Accept as Solution button if a post solves your issue or answers your question.

0 Likes
Message 9 of 18

Maxim-CADman77
Advisor
Advisor

thank for the reply. I can accept those two options as workaround but i fill frustrated with all those bad bodies which seems mostly occur rather by some technical issue then because of user's wrong action.

What are chances  that Inventot team would deeply investigate and clean up at least Content Center* (which job could probably point to the weak point)?

 

May be it's time to share the utility that can fix such things with no  need for user  to do extra work (I mean the utility mentioned in posts 4-6 of this thread)?

 

* meant this thread - https://forums.autodesk.com/t5/inventor-forum/bad-body-error-edge-goes-through-the-pole-of-a-surface...

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 10 of 18

kelly.young
Autodesk Support
Autodesk Support

@Maxim-CADman77 I just used the Ctrl+F7 in this situation and tried different modeling techniques, didn't use the development tools to investigate. I don't think we have any plans of releasing that to users. 

 

Not sure how or why those bad bodies are being created, I believe a lot of that has been addressed in newer releases for the sheet metal, not sure about Content Center as it is a collection that has grown over the years. 

 

Please select the Accept as Solution button if a post solves your issue or answers your question.

Message 11 of 18

YuhanZhang
Autodesk
Autodesk

With the data you attached, I created a VBA sample to fix the "Bad Body" issue,  you can open the B114QC11111.ipt and run the code to check if it solves the problem:

 

Sub FixBadBodyIssueInSheetMetal()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oSMDef As SheetMetalComponentDefinition
    Set oSMDef = oDoc.ComponentDefinition
    
    Dim oFaceFeature As FaceFeature
    Set oFaceFeature = oSMDef.Features.FaceFeatures(1)
    
    Dim oSk As PlanarSketch
    Set oSk = oFaceFeature.Definition.Profile.Parent
    
    Dim oFace As Face, oNormal As UnitVector, oOffsetFace As Face
    For Each oFace In oFaceFeature.Faces
        Set oNormal = oFace.Geometry.Normal
        
        If oNormal.IsParallelTo(oSk.PlanarEntityGeometry.Normal) Then
            Set oOffsetFace = oFace
            Exit For
        End If
    Next
    
    Dim oFaces As FaceCollection
    Set oFaces = ThisApplication.TransientObjects.CreateFaceCollection
    oFaces.Add oOffsetFace
    
    Dim oOffsetSur As ThickenFeature
    Set oOffsetSur = oSMDef.Features.ThickenFeatures.Add(oFaces, 0, kPositiveExtentDirection, kSurfaceOperation, True)
     
    Dim oDeleteFace As DeleteFaceFeature
    Set oDeleteFace = oSMDef.Features.DeleteFaceFeatures.Add(oOffsetFace.FaceShell)
    
    Set oFaces = ThisApplication.TransientObjects.CreateFaceCollection
    oFaces.Add oOffsetSur.Faces(1)
    
    Dim dThickness As Double
    Debug.Print oSMDef.Thickness.Expression
    
    Dim oThicken As ThickenFeature
    Set oThicken = oSMDef.Features.ThickenFeatures.Add(oFaces, oSMDef.Thickness.Expression, kNegativeExtentDirection, kJoinOperation, True)
    
    oOffsetSur.SurfaceBodies(1).Visible = False
End Sub

 

The code will delete the problematic Brep and create a new one, this will create some new features but should be unfoldable as before. Also if you have drawing views with the flat pattern from the sheet metal you need to check if the drawing views can be updated successfully after running the code. Hope this helps.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 12 of 18

Maxim-CADman77
Advisor
Advisor

Thank you
The approach based on thicken feature seems "Sheet-Metal applicable only" workaround.

But we also have Bad Bdies on Extrude, Revolve, Fillet and some other type of features.

Thus we need some other re-create-feature tool.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 13 of 18

YuhanZhang
Autodesk
Autodesk

Can you send me a sample data to check?



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 14 of 18

Maxim-CADman77
Advisor
Advisor

Sure - here they are:
see attached sample of Bad Body created with Revolve feature

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 15 of 18

Maxim-CADman77
Advisor
Advisor

Sample of Bad Body on Extrusion

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 16 of 18

Maxim-CADman77
Advisor
Advisor

Sample of Bad Body on Fillet

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 17 of 18

YuhanZhang
Autodesk
Autodesk
Accepted solution

It is complex in standard part for us to fix the bad body issue via API, if there are not too many parts have problem you can manually re-create the problematic features. Below VBA code can help to find the problematic feature in a standard part, you can run it multiple times for a part in case there are multiple problematic features:

 

 

Sub GetProblematicFeatureName()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oBody As SurfaceBody
    If IsBodyValid(oDoc) Then
        MsgBox "No bad body."
        Exit Sub
    End If
    
    Dim oAfter As Object, oBefore As Object
    Dim i As Integer, oBadFeature As PartFeature
    Do
        Call oDoc.ComponentDefinition.GetEndOfPartPosition(oAfter, oBefore)
        If InStr(1, LCase(TypeName(oAfter)), "feature") Then
            Set oBadFeature = oAfter
            oBadFeature.SetEndOfPart True
        End If
    Loop Until IsBodyValid(oDoc)
    
    oBadFeature.SetEndOfPart False
    MsgBox "The problematic feature is: " & oBadFeature.Name
End Sub

Function IsBodyValid(oDoc As PartDocument) As Boolean
    Dim oShell As FaceShell, oBody As SurfaceBody
    IsBodyValid = True
    Dim ooobj
    For Each oBody In oDoc.ComponentDefinition.SurfaceBodies
        For Each oShell In oBody.FaceShells
             If oBody.IsEntityValid(oShell, 7) = False Then
                IsBodyValid = False
                Exit For
             End If
        Next
    Next
End Function

 Hope it can help a bit.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 18 of 18

Maxim-CADman77
Advisor
Advisor

I can confirm your code works just as you've described it.

We already use a bit simplier (without bad feature name definition) custom (iLogic) "rule" within our corporate set of checks for Inventor Design Checker.
Unfortunately  as you know (https://forums.autodesk.com/t5/inventor-customization/automatic-check-of-inventor-design-perspective...) custom checks are useles in some cases (ex if  model contains iMates). .

..I still hope to get the  feedback promised .in that thread ...

Please vote for Inventor-Idea Text Search within Option Names

0 Likes