Message 1 of 6
inventor bug ?

Not applicable
03-27-2017
12:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi folks
I have some code that puts some values from parameters in an arry and sorts them and then uses the middel 2 values to do some calculations.
Now this code works but i have a problem when i run my form that triggers the rules then ilogic repeats some of the rules multiple times .
i have three rules the 1st en 2nd are correct but the 3th repeats multiple times and i don't know why.
in attachement you can find a screen cast of my problem, my appollogies its in dutch to put my code in english it would take for ever.
Code 1
SyntaxEditor Code Snippet
If Start= True Then Dim MyArrayList(3) As Double MyArrayList(0) = X_Afstand_1_Pir MyArrayList(1) = X_Afstand_2_Pir MyArrayList(2) = X_Afstand_3_Pir MyArrayList(3) = X_Afstand_4_Pir Array.Sort(MyArrayList) For Each Str As Double In MyArrayList Next MessageBox.Show(MyArrayList(1), "Co�rdinaat X1") MessageBox.Show(MyArrayList(2), "Co�rdinate X2") I1=Abs(MyArrayList(1))/((Binnen_diameter_Pir/2)+Laagdikte_Pir) J1=(Asin(I1)*180)/3.1415 M1=Abs(MyArrayList(2))/((Binnen_diameter_Pir/2)+Laagdikte_Pir) N1=(Asin(M1)*180)/3.1415 'Q1=J1+N1 elseif het gene hieronder ? If MyArrayList(2)<0 And MyArrayList(1)< 0 Then Q1=J1-N1 Else If MyArrayList(2)>0 And MyArrayList(1)> 0 Then Q1=N1-J1 End If MessageBox.Show(Q1, "Hoek tussen X1 en X2")
code 2
SyntaxEditor Code Snippet
If Start= True Then Dim MyArrayList(3) As Double MyArrayList(0) = X_Afstand_1_Pir MyArrayList(1) = X_Afstand_2_Pir MyArrayList(2) = X_Afstand_3_Pir MyArrayList(3) = X_Afstand_4_Pir Array.Sort(MyArrayList) For Each Str As Double In MyArrayList Next MessageBox.Show(MyArrayList(1), "Co�rdinaat X3") MessageBox.Show(MyArrayList(2), "Co�rdinaat X4") I1=Abs(MyArrayList(1))/((Binnen_diameter_Pir/2)+Laagdikte_Pir) J1=(Asin(I1)*180)/3.1415 M1=Abs(MyArrayList(2))/((Binnen_diameter_Pir/2)+Laagdikte_Pir) N1=(Asin(M1)*180)/3.1415 Q1=J1+N1 MessageBox.Show(Q1, "Hoek tussen X3 en X4") End If
SyntaxEditor Code Snippet
If Start= True Then Dim MyArrayList(3) As Double MyArrayList(0) = Y_Afstand_1_Pir MyArrayList(1) = Y_Afstand_2_Pir MyArrayList(2) = Y_Afstand_3_Pir MyArrayList(3) = Y_Afstand_4_Pir Array.Sort(MyArrayList) For Each Str As Double In MyArrayList Next MessageBox.Show(MyArrayList(1), "Co�rdinaat Y1") MessageBox.Show(MyArrayList(2), "Co�rdinaat Y2") Hoek_Alpha_Pir=(afstand_tussen_de_trekken*360)/(Binnen_diameter_Pir*3.1415) MessageBox.Show(Abs(Hoek_Alpha_Pir), "hoek booglengte") End If