Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Maxim-CADman77
in reply to: YuhanZhang

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