iLogic Check End of Part

iLogic Check End of Part

eugenio_fU5HMF
Contributor Contributor
315 Views
4 Replies
Message 1 of 5

iLogic Check End of Part

eugenio_fU5HMF
Contributor
Contributor

Goodmorning Folks,

I was looking for an Ilogic that give me back an error message if the "end fo part" of an .ipt is not at the bottom of the three.

This can avoid us to forget to move down the "end of part" and be sure the part is complete with all features.

 

Thanks for your help.

 

Ciao

0 Likes
Accepted solutions (1)
316 Views
4 Replies
Replies (4)
Message 2 of 5

Gabriel_Watson
Mentor
Mentor

Use the "HealthStatusEnum.kBeyondStopNodeHealth": 
https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-58D84911-253B-47F3-ABE7-3BF323CA85AD

 

For example:

 

Dim openDoc As Document
openDoc = ThisDoc.Document
Dim FeatureList As New ArrayList

For Each oFeature In openDoc.ComponentDefinition.Features
    If oFeature.HealthStatus = HealthStatusEnum.kBeyondStopNodeHealth = True  Then
            FeatureList.Add(oFeature.Name)
    End If		
Next

' Count the number of items in the FeatureList array
Dim FeatureCount As Integer
FeatureCount = FeatureList.Count

'Message box (customize this as you wish):
MessageBox.Show(FeatureCount, "Warning, features found below the End of Part marker:")

 

Message 3 of 5

eugenio_fU5HMF
Contributor
Contributor

Thanks so much for your solution.

Is it possible to edit this script and receive back the message just if the end of part is up?

0 Likes
Message 4 of 5

Gabriel_Watson
Mentor
Mentor
Accepted solution

Sure, you can modify the prompt any way you like. Add a condition:

 

'Message box (customize this as you wish):
If FeatureCount <> 0  Then
        MessageBox.Show(FeatureCount, "Number of features below End of Part:")
End If

 

Message 5 of 5

eugenio_fU5HMF
Contributor
Contributor

Thanks so much.

 

Regards,