ilogic and model parameters out of sync

ilogic and model parameters out of sync

peter.roman
Advocate Advocate
332 Views
2 Replies
Message 1 of 3

ilogic and model parameters out of sync

peter.roman
Advocate
Advocate

Hi,

 

I have an assembly with parameters:

mass

mass_engr = ceil(mass / 0.5 kg) * 0.5 kg [exported]

 

ilogic rule:

 

iLogicVb.UpdateWhenDone = True

'mass = iProperties.Mass Parameter("mass") = iProperties.Mass MessageBox.Show(CStr(mass) & "," & CStr(mass_engr) & "," & iProperties.Value("Custom", "mass_engr"), "Title") MessageBox.Show(CStr(Parameter("mass")) & "," & CStr(Parameter("mass_engr")) & "," & iProperties.Value("Custom", "mass_engr"), "Title")

mass_prop
= iProperties.Value("Custom", "mass_engr")
Dim part = "COVER PLATE"
iProperties.Value(part, "Custom", "mass_engr") = mass_prop

 

Q1

I have to  use [ Parameter("mass") = ] not [ mass = ] otherwise "mass_engr" and the exported custom iproperty don't update while the rule is running (used later by the rule).

 

Is there any way to force these to update if I use [ mass = ] ?

 

Q2

If I use [ Parameter("mass") = ]  so that the others update, then later directly using "mass" and "mass_engr" still gives the old non-updated values.

So I need to get the new values with Parameter("mass") and Parameter("mass_engr")

(the 1st message box gives old values, the 2nd gives updated values)

 

Is there anyway to "sync" parameters with the rule so that "mass" etc. give the new values?

 

 

 

0 Likes
333 Views
2 Replies
Replies (2)
Message 2 of 3

zoe.baker-bushby
Enthusiast
Enthusiast

On a whim, have you tried a 

iLogicVb.UpdateWhenDone = True

 after setting/changing any of your parameters.

0 Likes
Message 3 of 3

peter.roman
Advocate
Advocate

Hi, yes I have that one at the start of the rule (probably should of copied that one too, updated).

Although, wouldn't that not affect anything before the rule finishes?

 

I've also tried

Parameter.UpdateAfterChange = True

at the start but that didn't seem to do anything.

 

At this stage, it works if I make sure to use Parameter() everywhere but I'm trying to understand the difference in methods to not get caught out in the future (and save typing out Parameter() everywhere).

0 Likes