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