08-20-2018
01:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-20-2018
01:06 AM
For older Inventor versions (ex. 2014) this code will return only real sketches (skip auxiliary):
Dim oCompdef As PartComponentDefinition
oCompdef = ThisDoc.Document.ComponentDefinition
Dim oPane As BrowserPane
oPane = ThisDoc.Document.BrowserPanes("PmDefault")
Dim MsgBody As String
Dim RealSketchCount As Integer=0
For Each oSketch As Sketch In oCompdef.Sketches
On Error Resume Next
Dim oNode As BrowserNode
oNode = oPane.GetBrowserNodeFromObject(oSketch)
If Err.Number=0 Then
If oSketch.HealthStatus <> HealthStatusEnum.kBeyondStopNodeHealth Then
RealSketchCount=RealSketchCount + 1
MsgBody = MsgBody & oSketch.Name & vbCrLf
End If
End If
Next
MsgBox (MsgBody,,"Out of " & oCompdef.Sketches.Count & " sketches " & RealSketchCount & " are real: ")
Please vote for Inventor-Idea Text Search within Option Names