inventor parameter update delay

inventor parameter update delay

Anonymous
Not applicable
716 Views
8 Replies
Message 1 of 9

inventor parameter update delay

Anonymous
Not applicable

hi all

 

I have 2 codes that show 2 values from a plane that intersects with an edge 1 plane is parallel to the orgine one other plane is under angel that changes.

now when i run my code the values of the intersection of the parallel plane to the origin is correct but the values of the plane thats under an angel are wrong it's like inventor doesn't update correct or something like that.

 

it shows for the plane under an angle 12.46 but it should be 12.31. seee my screen cast

 

here are my 2 codes

 

Code1:

SyntaxEditor Code Snippet

InventorVb.DocumentUpdate(True)
If Start = False Then Exit Sub


MessageBox.Show( X_Afstand_1_Cil, "Co�rdinaat X1")        
MessageBox.Show( X_Afstand_2_Cil, "Co�rdinaat X2")
        
I1=Abs(X_Afstand_1_Cil)/((Binnen_diameter_cil/2)+Laagdikte_Cil)                                                
J1=(Asin(I1)*180)/3.1415                                                                                     
M1=Abs(X_Afstand_2_Cil)/((Binnen_diameter_cil/2)+Laagdikte_Cil)
N1=(Asin(M1)*180)/3.1415
Q1=J1+N1

MessageBox.Show(Q1, "hoekt tussen X1 en X2")    

Parameter("Start") = False

 Code 2

SyntaxEditor Code Snippet

InventorVb.DocumentUpdate(True)
If Start_Y = False Then Exit Sub


MessageBox.Show(Y_Afstand_1_Cil, "Co�rdinaat Y1")        
MessageBox.Show(Y_Afstand_2_Cil, "Co�rdinaat Y2")    

Hoek_Alpha_cil=(afstand_tussen_de_trekken*360)/(Binnen_diameter_cil*3.1415)

MessageBox.Show(Abs(Hoek_Alpha_cil), "hoek booglengte")    


Parameter("Start_Y") = False
Parameter("start_rules")=False

 

code 3 this code triggers the other 2

SyntaxEditor Code Snippet

If start_rules= True  Then
Start_Y= True
Start= True

End If

 

0 Likes
Accepted solutions (1)
717 Views
8 Replies
Replies (8)
Message 2 of 9

HermJan.Otterman
Advisor
Advisor

if you give a parameter a value than:

 

don't use:      Hoek = calculation

this will change the value at the end of the rule

 

but use          Parameter("Hoek") = calculation

(from the parameter snippets)

this will change the value directly

 

 

also put in the rule:

 

InventorVb.DocumentUpdate()

(from the Document snippets, Document update)

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


Message 3 of 9

Anonymous
Not applicable

thanks for you're fast replie wil try it

0 Likes
Message 4 of 9

Anonymous
Not applicable

It doesn't help

 

this is my code now 

 

SyntaxEditor Code Snippet

InventorVb.DocumentUpdate(True)
If Start_Y = False Then Exit Sub


MessageBox.Show(Y_Afstand_1_Cil, "Co�rdinaat Y1")        
MessageBox.Show(Y_Afstand_2_Cil, "Co�rdinaat Y2")    

Parameter("Hoek_Alpha_cil")=(afstand_tussen_de_trekken*360)/(Binnen_diameter_cil*3.1415)

MessageBox.Show(Abs(Hoek_Alpha_cil), "hoek booglengte")    


Parameter("Start_Y") = False
Parameter("start_rules")=False

 

0 Likes
Message 5 of 9

HermJan.Otterman
Advisor
Advisor

are the pieces of code in the same rule?

 

could you try to use the " Parameter("name") = calculation as well for the first code part?

 

if this is not helping, could you share your model? with the iLogic code.

 

it has something to do with the order in which things are done..

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes
Message 6 of 9

Anonymous
Not applicable

yeah i can share my part

 

to use the code you have to select the form keuze figuur and select cilinder

then you change afstand_tot_center_cil to a value you want

then you change afstand_tussen_de_trekken

then you put start_rules on true

 make sure that start and start_y are on false .

 

in attachement you will find my part.

0 Likes
Message 7 of 9

HermJan.Otterman
Advisor
Advisor
Accepted solution

if you add a new rule at the end and put in only the two lines:

 

 

MessageBox.Show(Y_Afstand_1_Cil, "Coördinaat Y1")        
MessageBox.Show(Y_Afstand_2_Cil, "Coördinaat Y2")    

 then they will show you (twice) the correct values, so al other update have been done then.

 

so after rule code x richting cilinder the changes take place..

 

so for some reason the values are not calculated when you ask for them.

 

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes
Message 8 of 9

Anonymous
Not applicable

thanks would you know the reason why this problem occurs?

0 Likes
Message 9 of 9

HermJan.Otterman
Advisor
Advisor

it has to do with the order in which the calculations are done.

most of the values are changed at the end of a rule, when the rule is finished and not before.

 

I'm not shure where the point depend on but if they are related to the geometry, then that has to update first.

so it has to do with the order.

the last rule is a new rule, so all rules before that have finished, and the parameters than have the right values.

 

i cant find why the inbetween updates don't work.

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes