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

Can you try below code if it helps:

 

Dim oCompdef As PartComponentDefinition
oCompdef = ThisDoc.Document.ComponentDefinition

Dim oPane As BrowserPane
oPane = ThisDoc.Document.BrowserPanes("PmDefault")
    
Dim MsgBody As String
Dim AboveEoP_SkCount As Integer=0
For Each oSketch As Sketch In oCompDef.Sketches
    
    Dim oNode As BrowserNode
    oNode = oPane.GetBrowserNodeFromObject(oSketch)
    
    If oNode.Visible And oSketch.HealthStatus <> HealthStatusEnum.kBeyondStopNodeHealth Then
        SkCount = AboveEoP_SkCount + 1
        MsgBody = MsgBody & "                     " & oSketch.Name & " - " & oSketch.IsOwnedByFeature & vbCrLf
    Else
        Exit For
    End If
Next
MsgBox (MsgBody,,"Out of " & oCompDef.Sketches.Count & " sketches " & AboveEoP_SkCount & " are placed above EoP:     ")


If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.