iLogic code delay

iLogic code delay

Daan_M
Collaborator Collaborator
1,505 Views
1 Reply
Message 1 of 2

iLogic code delay

Daan_M
Collaborator
Collaborator

Hi forum,

 

I've had a problem with my iLogic code for a while now.

Inside a assembly i change the orientation of a part, after that i want to save the assembly as step and write it to a local disk. The value for the orientation change comes from a Excel document, see the code below.

 

d2 = GoExcel.CellValue(Excelfile, "Sheet1", "B5")

iLogicVb.UpdateWhenDone = True

Stepfilename = Excelnamevalue
ThisDoc.Document.SaveAs("C:\Data\Output\" & Stepfilename & ".stp", True)

 

When i look at the model executing the code everything looks fine and the orientation changes. But when i open the saved stepfile the orientation hasn't changed and is still the same as it was. 

 

It is as if the saving of the file happends before the iLogicVB.UpdateWhenDone is fully executed, for some reason.

 

Maybe a delay could fix this? any ideas or suggestions?

 

 

 

 

0 Likes
Accepted solutions (1)
1,506 Views
1 Reply
Reply (1)
Message 2 of 2

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @Daan_M 

iLogicVB.UpdateWhenDone = True means that the document updates after the rule is done...

What happens if you change it to:

 

d2 = GoExcel.CellValue(Excelfile, "Sheet1", "B5")

RuleParametersOutput()
InventorVb.DocumentUpdate() 'Maybe overkill



Stepfilename = Excelnamevalue
ThisDoc.Document.SaveAs("C:\Data\Output\" & Stepfilename & ".stp", True)