Inventor Parameter Update

Inventor Parameter Update

calaes
Contributor Contributor
465 Views
6 Replies
Message 1 of 7

Inventor Parameter Update

calaes
Contributor
Contributor

I have some iLogic that loops through a .csv file, and pulls values from this file and assigns them to Parameters. The issue arises in the fact that as soon as I try to utilize one of the just set parameters, it's like the parameters were never set. I have tried to set the parameters via paramobject.Value & paramobject.expression as well as the ilogic Parameter("ParamName") method, but both provide the same result. I also have placed a RuleParametersOutput() & InventorVb.DocumentUpdate() after each time a parameter is brought in from the csv file, but still its like the parameter was never updated.

 

Any assistance would be much appreciated. I understand that perhaps the best course of action would be to place the CSV value load into another rule, but I'm hoping I don't have to.

 

Thanks for any help.

0 Likes
Accepted solutions (2)
466 Views
6 Replies
Replies (6)
Message 2 of 7

Lewis.Young
Collaborator
Collaborator

Hello,

 

Try adding this line to your code and see if it helps?

ThisDoc.Document.Rebuild() 

 If that doesn't solve it, maybe this does?

iLogicVb.UpdateWhenDone = True

 

Lewis

Message 3 of 7

calaes
Contributor
Contributor

No luck. Tried in combination with the Parameter("ParamName") & ParameterObject.Value()/Parameter.Expression() methods.

0 Likes
Message 4 of 7

johnsonshiue
Community Manager
Community Manager

Hi! Maybe there is something else at play. Please share the iLogic rule or the part with the rule.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 5 of 7

calaes
Contributor
Contributor

I have attached the code. I pulled out any code that was irrelevant/ pertained directly to my company. This code has been tested thoroughly in being able to pull the values from the CSV. 

 

Directly following this code there is an <if> statement that references one of the parameters set by line 43. This has so far been unsuccessful in running and setting the correct value on the first run of the rule. I usually just have to run the rule multiple times to get it to work. I am unable to run this lookup via excel because of issues when running this on our automated system.

 

Thanks

0 Likes
Message 6 of 7

MjDeck
Autodesk
Autodesk
Accepted solution

This is a limitation of iLogic. The values of parameter variables in a rule are loaded from the Inventor model when the rule starts running, and are written back (if modified) when the rule finishes. But while the rule is running, they don't automatically track the values in the model. You have to add statements to explicitly assign each parameter if you want to use it after loading the values from CSV. Here's a sample:

Length = Parameter("Length")
Width = Parameter("Width")
If Length > 100 Then
' ...
End If

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 7 of 7

calaes
Contributor
Contributor
Accepted solution
Ok. This is what i was somewhat suspecting. Thamks for the confirmation though. I guess i Will be placing my csv parameter value pulls in seperate rules so everything updates appropriately.
0 Likes