Suppress messagebox

Suppress messagebox

jostroopers
Collaborator Collaborator
478 Views
3 Replies
Message 1 of 4

Suppress messagebox

jostroopers
Collaborator
Collaborator

I have a part with two features.
If the location of feature 1 gets over the location of feature 2  I get a message box.
If I suppress feature 2  I want the message box does not appear.
How can I disable the message box as feature 2 suppressed.

Look in rule: Aansturen sparing.

 

Thanks

Mvg Jos
Youre drawings are as good as the symbols that compleet them.....
0 Likes
Accepted solutions (2)
479 Views
3 Replies
Replies (3)
Message 2 of 4

CCarreiras
Mentor
Mentor
Accepted solution

HI!

 

Add the condition for Sparing 2  suppressed or not...

 

SyntaxEditor Code Snippet

If Feature.IsActive("Sparing2") = True Then
                'Melding als de locatie afstand van sparing 1 groter is dan sparing locatie 2.
                If SparingLocatie1 >= SparingLocatie2 Then
                MessageBox.Show("Let op afstand sparing 1 is groter dan sparing 2 ", "Afstand sparing")
                    End If
                
                '�ls sparing locatie 1 is groter dan sparing locatie 2 word sparing 2 met 110mm voorbij sparing 1 geplaatst.    
                If SparingLocatie1 >= SparingLocatie2 Then
                    SparingLocatie2 = SparingLocatie1 + 110
                End If
End If

CCarreiras

EESignature

0 Likes
Message 3 of 4

Owner2229
Advisor
Advisor
Accepted solution

Hi, here is your rule "Aansturen sparing" a bit updated:

 

 

'Sparing type nummer aansturen afhankelijk van keuze.
Select Case Sparingtype
	Case "Sparing 1"
	Sparing_type_nr = 1
	Case "Sparing 2"
	Sparing_type_nr = 2
	Case Else
	Sparing_type_nr = 0
End Select

'Sparing aan of uit zetten afhankelijk van keuze.
If Sparing_type_nr = 1 Then
	Feature.IsActive("Sparing1") = True
	Feature.IsActive("Sparing2") = False
Else if Sparing_type_nr = 2 Then
	Feature.IsActive("Sparing1") = True
	Feature.IsActive("Sparing2") = True
Else if Sparing_type_nr = 0 Then
	Feature.IsActive("Sparing1") = False
	Feature.IsActive("Sparing2") = False
End If

'Melding als de locatie afstand van sparing 1 groter is dan sparing locatie 2.
If SparingLocatie1 >= SparingLocatie2 Then
If Feature.IsActive("Sparing2") = True Then
MessageBox.Show("Let op afstand sparing 1 is groter dan sparing 2 ", "Afstand sparing")
End If
End If

'Áls sparing locatie 1 is groter dan sparing locatie 2 word sparing 2 met 110mm voorbij sparing 1 geplaatst.
If SparingLocatie1 >= SparingLocatie2 Then
SparingLocatie2 = SparingLocatie1 + 110
End If

 

Should work now

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 4 of 4

jostroopers
Collaborator
Collaborator

Thanks, Carlos and Mike.

This works for me.

Mvg Jos
Youre drawings are as good as the symbols that compleet them.....
0 Likes