Part won't update after rule runs, after ipart member change

Part won't update after rule runs, after ipart member change

SharkDesign
Mentor Mentor
1,690 Views
24 Replies
Message 1 of 25

Part won't update after rule runs, after ipart member change

SharkDesign
Mentor
Mentor

I have an ilogic rule that spaces the holes out on a linear rail. 

Everything works perfectly until I convert it to iPart. I need to do this for content centre. 

When I change between factory members, the rule runs (I put a message box in to prove it) But the part doesn't update afterwards, despite using 

iLogicVb.UpdateWhenDone = True

Any ideas?

This is the abridged version

Parameter.UpdateAfterChange = True

If Size = "HGR15" Then
HoleCB = "7.5"
etc etc.......
BlindThreadDepth = 8

Else If Size = "HGR20" Then
etc etc................

End If
iLogicVb.UpdateWhenDone = True
ThisApplication.ActiveView.Fit

Inventor 2018

  Inventor Certified Professional
0 Likes
Accepted solutions (1)
1,691 Views
24 Replies
Replies (24)
Message 21 of 25

HermJan.Otterman
Advisor
Advisor

the rule now runs, when you change to an other size,

 

To update your part:

On the last line of the rule, add:

iLogicVb.UpdateWhenDone = True

that should update your part

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 22 of 25

clutsa
Collaborator
Collaborator
Accepted solution

Try throwing this at the bottom.

Dim app As Inventor.Application = ThisApplication
Dim LocalUpdate As ControlDefinition = app.CommandManager.ControlDefinitions("AppLocalUpdateCmd")
LocalUpdate.Execute
If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

0 Likes
Message 23 of 25

SharkDesign
Mentor
Mentor

Bloody ell that's so complicated. Is there a reason the normal "iLogicVb.UpdateWhenDone = True" doesn't work?

  Inventor Certified Professional
0 Likes
Message 24 of 25

clutsa
Collaborator
Collaborator

I wish I could give you a definitive answer as to why document.update and updatewhendone = true don't always work but, from my best understanding when the document updates it causes some other parameters to update and that doesn't trigger another update (probably to stop some potential infinite loop) so you're left with a dirty document even after update... I may be full of bologna however.

here's the same code as one line if that makes you feel better (it won't.)

ThisApplication.CommandManager.ControlDefinitions("AppLocalUpdateCmd").Execute

 

If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates

0 Likes
Message 25 of 25

HermJan.Otterman
Advisor
Advisor

so did you follow my steps? or just added this line?

 

if I only add your line, then the rule still is not triggered and don't run. , or does it run with you.?

 

once the rule is triggered, the "Update when done" updates the part with me....!?

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