Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic not updating a driven parameter

1 REPLY 1
SOLVED
Reply
Message 1 of 2
TommySWE
1060 Views, 1 Reply

iLogic not updating a driven parameter

I have a part file that I control using iLogic, the basic shape of the part is defined by a triangle like the one below

 

 

If I have the Length (3.9cm) as driven and use the height and angle to control the geometry I find a peculiar problem.

The triangle in the model window in Inventor changes the Length value (I have the sketch visible so I can see it happening) when I change the angle - just as you would expect. However, the running code does not recognize this change in the Length parameter, and even if I run a MsgBox(Length) at the very last line of the rule it states the old value.

 

This behavior results in that the dimension that the ilogic rule perceives is always one step behind the angle changes, which forces me to run the rule twice with the same angle to get the code to "Refresh" its parameter values.

 

I have tried running  all of the below update commands all over the code, but they dont update the Length parameter.

 

SyntaxEditor Code Snippet

iLogicVb.UpdateWhenDone() = True
RuleParametersOutput()
InventorVb.DocumentUpdate()

Is there any way to force an update or regeneration of parameters while running a rule? This behavior is really bizarre since I can look at the model and see the current value for the Length parameter, but the iLogic code is stuck with the previous value.

1 REPLY 1
Message 2 of 2
TommySWE
in reply to: TommySWE

I tried this with in an empty part with only a sketch of a triangle, and the behavior was the same.

However I found a solution to this problem;

 

As far as I can tell, you need to use RuleParametersOutput() and then refer to whatever parameter is needed with

Parameter.Param("ParameterName").Value*10

 
I have my units in millimeter and the base unit in Inventor seems to be centimeter, which is why I had to multiply the value by 10.

 

In addition to this I also added this to my code:

Parameter.UpdateAfterChange = True
MultiValue.UpdateAfterChange = True

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report