10-20-2021
11:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-20-2021
11:01 AM
Hello
Thanks for the files. I picked the part "Flight" in the part name to identify the parts we need.
The script is not perfect, but works so far.
Option Explicit on
Dim oApp As Inventor.Application= ThisApplication
Dim oDrawDoc As DrawingDocument = oApp.ActiveDocument
Dim oAssDoc As AssemblyDocument= oDrawDoc.ReferencedDocuments(1) 'we assume there is only one
Dim oObjColl As ObjectCollection = oApp.TransientObjects.CreateObjectCollection
Dim oOccs As ComponentOccurrencesEnumerator
Dim oOcc As ComponentOccurrence
Dim oDrawView As DrawingView
Dim oDrawCurves As DrawingCurvesEnumerator
Dim oDrawCurve As DrawingCurve
Dim oDrawCurveSeg As DrawingCurveSegment
Dim oRefedDoc As Document
Dim oTrans As Transaction = oApp.TransactionManager.StartTransaction(oDrawDoc, "HideLines")
For Each oDrawView In oDrawDoc.ActiveSheet.DrawingViews
If oDrawView.ViewType = DrawingViewTypeEnum.kStandardDrawingViewType Then
For Each oRefedDoc In oAssDoc.AllReferencedDocuments
If InStr(oRefedDoc.FullFileName, "Flight") Then
oOccs = oAssDoc.ComponentDefinition.Occurrences.AllReferencedOccurrences(oRefedDoc)
For Each oOcc In oOccs
oDrawCurves = oDrawView.DrawingCurves(oOcc)
For Each oDrawCurve In oDrawCurves
For Each oDrawCurveSeg In oDrawCurve.Segments
If oDrawCurveSeg.HiddenLine = True Then
oDrawCurveSeg.Visible = False
End If
Next
Next
Next
oDrawCurves = Nothing
End If
oOccs = Nothing
Next
End If
Next
oTrans.End
R. Krieg
RKW Solutions
www.rkw-solutions.com