×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Removing edge blends with lost references

Removing edge blends with lost references

Removing edge blends with lost references

(OP)
When creating complicated castings, we often get the lots of edge blends where the edges have been consumed by another feature or similar and our part navigator ends up with lots of warning triangles on those specific blends. Other than editing each edge blend separately and clicking the delete button inside the command, is there a way of deletin these enmasse? Using a journal perhpas? I thought part clean up might do it, but it doesn't.

Cheers

Si

Best regards

Simon NX 7.5.4.4 MP8 and NX 8.5 (native) - TC 8 www.jcb.com

RE: Removing edge blends with lost references

Hi JCBCAD,
i was just wondering if you can use CheckMate (Buried Features check)results (Visual Reporting) to filter all these blends and then delete it in one shot (right click the top-node of the reult and selecting SELECT ASSOCIATED OBJECTS and delete it).
Or maybe using FILTER SETTINGS in part navigator to filter down features " features with warning" and then delete them.
Best Regards
Kapil Sharma

RE: Removing edge blends with lost references

JBCAD Did you ever find a good solution to this question? Thanks

RE: Removing edge blends with lost references

(OP)
SDETERS

Nothing other that what you see here.

Happy New Year smile

Best regards

Simon NX 7.5.4.4 MP8 and NX 8.5 (native) - TC 8 www.jcb.com

RE: Removing edge blends with lost references

Using selection intent (tangent curves, connected curves, face edges etc) instead of selecting multiple edges would minimise the number of consumed edges, although the feature would fail if the seed edge is consumed upon editing.

Khimani Mohiki
Design Engineer - Aston Martin
NX8.5

RE: Removing edge blends with lost references

(OP)
It's fixed in NX9, it basically deletes any lost edges for you smile

Best regards

Simon NX 7.5.4.4 MP8 and NX 8.5 (native) - TC 8 www.jcb.com

RE: Removing edge blends with lost references

Thanks gives us another reason to push for upgrading to NX 9 in spring time.

RE: Removing edge blends with lost references

Hi Simon,
I'm testing NX9 and I don't find this fix.
Is it an information arrived from SIEMENS or have you tested personally ?

Thank you...

Using NX 8 and TC9.1

RE: Removing edge blends with lost references

Here's some code, but it is not thoroughly tested. Post back if/when you encounter a problem.

CODE

'http://www.eng-tips.com/viewthread.cfm?qid=356772
'clean invalid edge references from edge blends
'not thouroughly tested for variable radius blends
'February 10, 2014

Option Strict Off  
Imports System  
Imports System.Collections.Generic  
Imports NXOpen  

Module BlendCleaner  

    Sub Main()  

        Dim theSession As Session = Session.GetSession()  
        Dim workPart As Part = theSession.Parts.Work  

        Dim lw As ListingWindow = theSession.ListingWindow  
        lw.Open()  

        Const undoName As String = "Blend Cleaner"  
        Dim markId1 As Session.UndoMarkId  
        markId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, undoName)  

        Dim numCleaned As Integer = 0  

        Dim nullFeature As Features.Feature = Nothing  
        Dim currentFeat As Features.Feature = workPart.CurrentFeature  

        Dim prevFeat As Features.Feature = Nothing  
        For Each tempFeat As Features.Feature In workPart.Features  

            If tempFeat.FeatureType = "BLEND" Then  

                Dim myBlend As Features.EdgeBlend = tempFeat  
                Dim blendWarnings() As String = myBlend.GetFeatureWarningMessages()  
                Dim needsCleaning As Boolean = False  

                For Each myLine As String In blendWarnings  
                    If myLine.ToLower.Contains("consumed") Then  
                        needsCleaning = True  
                    End If  
                Next  

				'make previous feature the current feature
                prevFeat.MakeCurrentFeature()  

				'edit blend feature with rollback
                workPart.Features.SetEditWithRollbackFeature(myBlend)  

                Dim blendBuilder As Features.EdgeBlendBuilder = workPart.Features.CreateEdgeBlendBuilder(myBlend)  

                Dim validEdges As New List(Of Edge)  

                Dim myCollector As ScCollector  
                Dim myExp As Expression  
                Dim valid As Boolean  
                For i As Integer = 0 To blendBuilder.GetNumberOfValidChainsets - 1  
                    blendBuilder.GetChainsetAndStatus(i, myCollector, myExp, valid)  

                    Dim myObjects() As TaggedObject = myCollector.GetObjects  

                    For Each temp As Edge In myObjects  
                        Try  
                            temp.GetLength()  
                            validEdges.Add(temp)  

                        Catch ex As NXException  
						'edge has been consumed or suppressed
                        End Try  
                    Next  

                    Dim edgeMultipleSeedTangentRule1 As EdgeMultipleSeedTangentRule  
                    edgeMultipleSeedTangentRule1 = workPart.ScRuleFactory.CreateRuleEdgeMultipleSeedTangent(validEdges.ToArray, 0.5, True)  

                    Dim rules1(0) As SelectionIntentRule  
                    rules1(0) = edgeMultipleSeedTangentRule1  
                    myCollector.ReplaceRules(rules1, False)  

                    Dim csIndex1 As Integer  
                    csIndex1 = blendBuilder.AddChainset(myCollector, myExp.Value.ToString)  

                Next  

                blendBuilder.CommitFeature()  
                blendBuilder.Destroy()  

                numCleaned += 1  

                currentFeat.MakeCurrentFeature()  
                workPart.Features.SetEditWithRollbackFeature(nullFeature)  

            End If  

            prevFeat = tempFeat  

        Next  

        If numCleaned > 0 Then  
            theSession.SetUndoMarkVisibility(markId1, undoName, Session.MarkVisibility.Visible)  
        End If  
        lw.Close()  

    End Sub  

End Module 

www.nxjournaling.com

RE: Removing edge blends with lost references

I get this error Cowski.

Line 49 "SetEditwithrollbackfeature" is not a member of "NXopen.Features.FeatureCollection".
LINE 91 "SetEditwithrollbackfeature" is not a member of "NXopen.Features.FeatureCollection".

RE: Removing edge blends with lost references

I should have mentioned that I tested it on NX 8.5. "SetEditWithRollbackFeature" is new to NX 8, I'll see if there is an alternative to use in NX 7.5...

www.nxjournaling.com

RE: Removing edge blends with lost references

I am on nx7.5 Sorry

RE: Removing edge blends with lost references

Ok, this version tested with NX 7.5.

CODE

Option Strict Off  
Imports System  
Imports System.Collections.Generic  
Imports NXOpen  

Module BlendCleaner_75  

    Sub Main()  

        Dim theSession As Session = Session.GetSession()  
        Dim workPart As Part = theSession.Parts.Work  

        Dim lw As ListingWindow = theSession.ListingWindow  
        lw.Open()  

        Const undoName As String = "Blend Cleaner"  
        Dim markId1 As Session.UndoMarkId  
        markId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, undoName)  

        Dim numCleaned As Integer = 0  

        Dim nullFeature As Features.Feature = Nothing  
        Dim currentFeat As Features.Feature = workPart.CurrentFeature  

        Dim prevFeat As Features.Feature = Nothing  
        For Each tempFeat As Features.Feature In workPart.Features  

            If tempFeat.FeatureType = "BLEND" Then  

                Dim myBlend As Features.EdgeBlend = tempFeat  
                Dim blendWarnings() As String = myBlend.GetFeatureWarningMessages()  
                Dim needsCleaning As Boolean = False  

                For Each myLine As String In blendWarnings  
                    If myLine.ToLower.Contains("consumed") Then  
                        needsCleaning = True  
                    End If  
                Next  

                If needsCleaning Then  
                   'make previous feature the current feature
                    prevFeat.MakeCurrentFeature()  

                   'edit blend feature with rollback
                   'workPart.Features.SetEditWithRollbackFeature(myBlend)

                    Dim blendBuilder As Features.EdgeBlendBuilder = workPart.Features.CreateEdgeBlendBuilder(myBlend)  

                    Dim validEdges As New List(Of Edge)  

                    Dim myCollector As ScCollector  
                    Dim myExp As Expression  
                    Dim valid As Boolean  
                    For i As Integer = 0 To blendBuilder.GetNumberOfValidChainsets - 1  
                        blendBuilder.GetChainsetAndStatus(i, myCollector, myExp, valid)  

                        Dim myObjects() As TaggedObject = myCollector.GetObjects  

                        For Each temp As Edge In myObjects  
                            Try  
                                temp.GetLength()  
                                validEdges.Add(temp)  

                            Catch ex As NXException  
                               'lw.WriteLine("  error: " & ex.Message)
                               'edge has been consumed or suppressed
                            End Try  
                        Next  

                        Dim edgeMultipleSeedTangentRule1 As EdgeMultipleSeedTangentRule  
                        edgeMultipleSeedTangentRule1 = workPart.ScRuleFactory.CreateRuleEdgeMultipleSeedTangent(validEdges.ToArray, 0.5, True)  

                        Dim rules1(0) As SelectionIntentRule  
                        rules1(0) = edgeMultipleSeedTangentRule1  
                        myCollector.ReplaceRules(rules1, False)  

                        Dim csIndex1 As Integer  
                        csIndex1 = blendBuilder.AddChainset(myCollector, myExp.Value.ToString)  

                    Next  

                    blendBuilder.CommitFeature()  
                    blendBuilder.Destroy()  

                    numCleaned += 1  

                    currentFeat.MakeCurrentFeature()  
                    'workPart.Features.SetEditWithRollbackFeature(nullFeature)

                End If  


            End If  

            prevFeat = tempFeat  

        Next  

        If numCleaned > 0 Then  
            theSession.SetUndoMarkVisibility(markId1, undoName, Session.MarkVisibility.Visible)  
        End If  
        lw.Close()  

    End Sub  

End Module 

www.nxjournaling.com

RE: Removing edge blends with lost references

This works great. Slow to rebuild the model but it could be an issue with my model. Nice One hundered stars to Coswki.

RE: Removing edge blends with lost references

It looks for blends with missing references, if these occur early in the file it will essentially rebuild the entire solid. On large files, this can be a long process.

www.nxjournaling.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources