iLogic: SharedVariable not working.

iLogic: SharedVariable not working.

shizahkhalid
Contributor Contributor
249 Views
1 Reply
Message 1 of 2

iLogic: SharedVariable not working.

shizahkhalid
Contributor
Contributor

SharedVariable is giving me a "Variable does not exist." error when I use it in another rule.

Here is how I created the variable:

 

 

Dim StringerLength As Integer
StringerLength = Parameter("Stringer Left", "cutref4") + (StringerHeight / Sin((angle / 180) * PI)) - (Parameter("Stringer Left", "width")/Tan((angle / 180) * PI))
SharedVariable("StringerLength") = StringerLength

 

 

And using this variable in another rule as follows:

 

 

AvailableLength = SharedVariable("StringerLength") - rise*Sin((angle / 180) * PI) - BoxWidth/Cos((angle / 180) * PI)

 

 

Error message:

shizak_1977_0-1713889923109.png

 

I should also point out that this code is working perfectly on my colleague's system, so it might be something to do with my version of Inventor (I've updated it and re-installed). Is there an error with the way I am declaring the shared variable? Would appreciate any guidance.

0 Likes
250 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor

Hi @shizahkhalid 

 

Not sure about your exact code but it should work. Can you debug each line?

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes