Hide break lines in ISO view

Hide break lines in ISO view

Anonymous
Not applicable
1,312 Views
8 Replies
Message 1 of 9

Hide break lines in ISO view

Anonymous
Not applicable

Hi all,

 

This is my first post on the Inventor Customization board.

 

I am curious to know if anyone knows of a way to hide the break lines that are created during a projected view.  I'm constantly hiding them by selecting them individually, which can be tedious in complex parts.

 

I like to think I'm good at programming, but I'm not and expert.  Still lots to learn.

 

So far it seems like they are not able to be put on a separate layer like the break itself.

 

Thanks is advance for any suggestions.

0 Likes
Accepted solutions (1)
1,313 Views
8 Replies
Replies (8)
Message 2 of 9

RodrigoEiras
Advocate
Advocate

 

Could you clarify which are "the break lines that are created during a projected view" you are referring to?. A screenshot would be perfect!

 

 

 

 

0 Likes
Message 3 of 9

Anonymous
Not applicable
 
0 Likes
Message 4 of 9

RodrigoEiras
Advocate
Advocate

Normally that line should not appear. Maybe is related to the way the part is created. Is it an only solid or two solids?.

 

If you could share the file I would try to make a projected view and give you some feedback.

 

Best regards

 

 NoBreakLine.JPG

0 Likes
Message 5 of 9

Anonymous
Not applicable

Here is a sample file.  The break line gap is set to .001mm  we have many parts that require 5-6 breaks on a drawing to fit and still show all the features.

0 Likes
Message 6 of 9

RodrigoEiras
Advocate
Advocate

Hi Payne530,

 

I also need the referenced part/s to be able to see the example. Please send it when possible.

 

Best regards

 

 

 

0 Likes
Message 7 of 9

Anonymous
Not applicable

Oops sorry about that.  Here is the related part file.  Hope this works.

0 Likes
Message 8 of 9

Anonymous
Not applicable
Accepted solution

Hi all,

 

I had an epiphany last night and wrote this little bit of code.

 

Private Sub HideBreakLinesInIso(ByRef oDrawingView As DrawingView)

    Dim oDrawingCurves As DrawingCurvesEnumerator
    Dim oDrawingCurve As DrawingCurve
    Dim oDrawingCurveSegment As DrawingCurveSegment
    Dim oBreakFace As Face
    Dim oCreatedByFeature As PartFeature
    Dim oBreakCurves As ObjectCollection
    
    Set oBreakCurves = ThisApplication.TransientObjects.CreateObjectCollection
    
    Set oDrawingCurves = oDrawingView.DrawingCurves
    
    For Each oDrawingCurve In oDrawingCurves
    
        If TypeName(oDrawingCurve.ModelGeometry) = "Face" Then
            Set oBreakFace = oDrawingCurve.ModelGeometry
            
            On Error Resume Next 'Turn error checking off
            
            Set oCreatedByFeature = oBreakFace.CreatedByFeature 'Throws error if no createdbyfeature

            On Error GoTo 0 'Turn error checking on
            
            Select Case Err
                Case 0 'No error occured
                    If TypeName(oCreatedByFeature) = "ReferenceFeature" Then 'Edge belongs to the reference plane used in the break operation
                        For Each oDrawingCurveSegment In oDrawingCurve.Segments
                            oDrawingCurveSegment.Visible = False
                        Next
                    End If
                Case -2147467259 'Method 'CreatedByFeature' of object 'Face' failed
                    'Unhandled
                Case Else
                    Debug.Print "ERROR: " & Err.Number & " " & Err.Description
                    Debug.Assert False
            End Select

        End If
    
    Next

End Sub

  This will hide the drawing curves created by the break object in a view.

 

We handle really long parts on a daily basis that we usually break in multiple spots.  The guys on the shop floor like to have an Iso view of the parts. 

0 Likes
Message 9 of 9

Anonymous
Not applicable

Hi Payne

 

Thanks for this code..

 

I have tried to get this working in Inventor pro 2016 as is, but it won't register it in the macro list (to do with the contents of the sub line (not sure how to launch this, so i decided to have a crack at a macro that could be run across multiple sheets and views at the same time (you'll have to excuse my noob-ness)

 

I get no erros when I run this, but the view I am testing remains unchanged:

 

Sub HideBreakLinesInIso()

    Dim oDocument As DrawingDocument
    Dim oSheets As Sheets
    Dim oSheet As Sheet
    Set oDocument = ThisApplication.ActiveDocument
    Set oSheets = oDocument.Sheets
   
    For Each oSheet In oSheets
       
        Dim oDrgViews As DrawingViews
        Set oDrgViews = oSheet.DrawingViews
        Dim oDrgView As DrawingView
       
        For Each oDrgView In oDrgViews
       
        Dim oBreakCurves As ObjectCollection
        Set oBreakCurves = ThisApplication.TransientObjects.CreateObjectCollection
        Dim oDrawingCurves As DrawingCurvesEnumerator
        Set oDrawingCurves = oDrgView.DrawingCurves
        Dim oDrawingCurve As DrawingCurve
           
            For Each oDrawingCurve In oDrawingCurves
           
            Dim oDrawingCurveSegment As DrawingCurveSegment
            Dim oBreakFace As Face
            Dim oCreatedByFeature As PartFeature
               
                If TypeName(oDrawingCurve.ModelGeometry) = "Face" Then
                    Set oBreakFace = oDrawingCurve.ModelGeometry
                       
                    On Error Resume Next 'Turn error checking off
                       
                    Set oCreatedByFeature = oBreakFace.CreatedByFeature 'Throws error if no createdbyfeature
           
                    On Error GoTo 0 'Turn error checking on
                       
                    Select Case Err
                        Case 0 'No error occured
                            If TypeName(oCreatedByFeature) = "ReferenceFeature" Then 'Edge belongs to the reference plane used in the break operation
                                For Each oDrawingCurveSegment In oDrawingCurve.Segments
                                    oDrawingCurveSegment.Visible = False
                                Next
                            End If
                        Case -2147467259 'Method 'CreatedByFeature' of object 'Face' failed
                            'Unhandled
                        Case Else
                            Debug.Print "ERROR: " & Err.Number & " " & Err.Description
                            Debug.Assert False
                    End Select
           
                End If
               
            Next
           
        Next
       
    Next
   
End Sub

 

I am guessing it is to do with how it is exiting out of the views after each loop, and possibly annihilating any changes to the visible switches on the line segments.

 

any help would be greatly appreciated!

 

Matt

0 Likes