Rule looping, cyclus is wrongly running twice

Rule looping, cyclus is wrongly running twice

BRLMCHKD
Advocate Advocate
1,049 Views
9 Replies
Message 1 of 10

Rule looping, cyclus is wrongly running twice

BRLMCHKD
Advocate
Advocate

Hi.

 

I got problem, that my rule LinerMachining is running twice when the InputBox is activated.

 

Someone who could give me a simpel tip to overcome that problem? 🙂

 

(.ipt and screendumps attached)

 

KR

BRLMCHKD

0 Likes
Accepted solutions (1)
1,050 Views
9 Replies
Replies (9)
Message 2 of 10

clutsa
Collaborator
Collaborator

Try going into the options for rule LDM_Min/Max and check the "Don't run automatically". I think because that's triggering a parameter change and then LinerMachining is triggering another parameter change.

I also see sometimes you use 'Parameter("ParameterName") = Value' and some times 'ParameterName = Value' and I think iLogic handles the timing of the changes differently for those so that may have something to do with it too. 

If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

Message 3 of 10

fullevent
Advisor
Advisor

Hello @BRLMCHKD

 

For me your rule is doing what it should (one cyclus) without modifying anything.. on inventor 2018.

I think @clutsas proposals should help you.

 

..by the way 'Parameter("ParameterName") = Value' chances the value immediately and 'ParameterName = Value' chances the value after running the rule.. at least as far as i know. Maybe the first command is better here.

 

What version do you use?

Maybe you mapped by mistake your rule to an (global) event so that it triggers a second time?

Just an idea because it works for me without any problems

 

greetings


Aleksandar Krstic
Produkt- und Projektmanager

Message 4 of 10

BRLMCHKD
Advocate
Advocate

Hi there.

I have now corrected the rule after your recomendations 🙂

 

Parameter ("LDM_Min") = 

 

Thank you very much.

KR

BRLMCHKD

0 Likes
Message 5 of 10

BRLMCHKD
Advocate
Advocate

Hi there.

 

I still have the problem with the rule 'LinerMachining' running twice

 

Easy to 'provoke' when the parameter 'OutPipeDia' is changed back and forth, and then choose a 'LinerDia' which

activates the rule 'LinerMachining'.

 

See attached  screendump: 1_Running twice_21.08.2018

 

We uses Inventor 2017, but changes very soon to Inventor 2018

 

I do have a sense of where the error lies
but do not know how to get around the problem?  See attached screendump: 2_Running twice_21.08.2018

 

If this problem could be eliminated, I do have the beginning of a skeleton part, which could meet all my wishes 🙂

 

Someone got an idea? 

 

KR

BRLMCHKD

0 Likes
Message 6 of 10

fullevent
Advisor
Advisor

Ok here we go, now i was able to reproduce your "bug".. fortunately its the same story 🙂

 I had the same issue some months befor.

 

its the because of the line:

LinerMachining = True

here you also have to do it this way:

Parameter("LinerMachining") = True

so that the parameter will be set immediatly.

I just changed the lines where you write the parameters.. so this is the hole rule I got now:

iLogicVb.UpdateWhenDone=True

OutPipeClearanceDia=OutPipeDia-2*(OutPipeTck+Clearance) 'Only informative reference given in parameter list


Parameter("LDM_Min") = LinerDia-2*(LinerTck*0.5) 'Chosen minimum Dia for Liner when machined
Parameter("LDM_Max") = LinerDia-2*(LinerTck*0.1) 'Chosen minimum Dia for Liner when machined

If LinerDia <= OutPipeDia-2*(OutPipeTck+Clearance) Then
Parameter("LinerMachining") = False
Feature.IsActive("Extrusion4_LinerMachining")=False
End If


If LinerDia > OutPipeDia-2*(OutPipeTck+Clearance) AndAlso LinerDia <= LinerMaxOverSize Then
'LinerMaxOverSize = Chosen Max LinerDia for Purchased oversize Pipe (conditions where Liner have to be machined)
Answer=MessageBox.Show("Liner requires machining!", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation)
End If


If Answer=vbYes Then 
myparam=InputBox("Please enter a value between LDM_Min and LDM_Max","LinerDiaMachined",">="& LDM_Min & "and <=" & LDM_Max)
If myparam = "" Then Exit Sub '<=== Added this line
MessageBox.Show("Value=" & myparam, "The value I entered")
LinerDiaMachined=myparam
Parameter("LinerMachining") = True
Feature.IsActive("Extrusion4_LinerMachining") = True
iLogicVb.UpdateWhenDone=True


ElseIf Answer=vbNo Then
MessageBox.Show("OutPipeDia will then be" & vbCr & vbCr & "auto preset 1 step up", "Information")
Parameter("LinerMachining") = False
Feature.IsActive("Extrusion4_LinerMachining")=False
End If


If LinerMachining = "False" Then
OutPipeDiaMin=LinerDia+2*(OutPipeTck+Clearance) 'Preselected Min Dia of OutPipe
foundVal=MultiValue.FindValue(MultiValue.List("OutPipeDia"),">",OutPipeDiaMin)
Parameter("OutPipeDia")=foundVal
End If

If LinerDia > LinerMaxOverSize Then
OutPipeDiaMin=LinerDia+2*(OutPipeTck+Clearance) 'Preselected Min Dia of OutPipe
foundVal=MultiValue.FindValue(MultiValue.List("OutPipeDia"), ">", OutPipeDiaMin)
Parameter("OutPipeDia")=foundVal
Parameter("LinerMachining") = False
Feature.IsActive("Extrusion4_LinerMachining")=False
End If

 

I hope it works for you!

 

greetings


Aleksandar Krstic
Produkt- und Projektmanager

Message 7 of 10

BRLMCHKD
Advocate
Advocate

Hi fullevent.

 

Hmm your solution gives me some other problems, but thank you very much for your reply 🙂

 

5_Running twice_21.08.2018.png

0 Likes
Message 8 of 10

BRLMCHKD
Advocate
Advocate
Accepted solution
Instead, I've got it to work this way (without my InputBox, cycles twice)
see screenshot.
 
4_Running twice_21.08.2018.png
Message 9 of 10

clutsa
Collaborator
Collaborator

I thought I replied with this question once already but don't see it in the forum so if I'm repeating myself I apologize.

 

Going into the options for rule LDM_Min/Max and check the "Don't run automatically" isn't working for you? I'm in 2018 but that's all I had to do to make it work.

If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

Message 10 of 10

BRLMCHKD
Advocate
Advocate

Thank you very much for your tips 🙂

 

I have deleted my rule 'LDM_Min/Max' and instead pasted the two lines into LinerMachining,

 

Now it works perfectly for me 🙂6_Running twice_21.08.2018.png