- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am having trouble getting this to work.
I have VBA running in Excel that cycles through many iterations of an assembly changing the parameters in each cycle.
Simplified, on the excel side it changes the parameters, saves the file and then waits for 30 sec before repeating.
Inventor is detecting the change via a trigger (set in excel with a NOW()). Then it should update model, and then save as dwg and obj (with name brought in from excel).
PROBLEM:
What I am realizing is that it is not saving them with the current model, but rather the model of the previous iteration.
Below is the ilogic script, with ' comments of things I have tried to no avail. Any suggestions on how to force update before proceeding with rest of script?
trigger = ExcelTrigger brand = GoExcel.CellValue("dimensions.xlsm", "Sheet2", "B7") family = GoExcel.CellValue("dimensions.xlsm", "Sheet2", "B8") full_name = GoExcel.CellValue("dimensions.xlsm", "Sheet2", "B9") part_num = GoExcel.CellValue("dimensions.xlsm", "Sheet2", "B10") file_name = GoExcel.CellValue("dimensions.xlsm", "INPUT", "B2") file_directory = GoExcel.CellValue("dimensions.xlsm", "INPUT", "G2") 'RuleParametersOutput() 'InventorVb.DocumentUpdate() Call ThisApplication.CommandManager.ControlDefinitions.Item("AppLocalUpdateCmd").Execute Call ThisApplication.CommandManager.ControlDefinitions.Item("AppGlobalUpdateWrapperCmd").Execute System.Threading.Thread.CurrentThread.Sleep(15000) 'iLogicVb.UpdateWhenDone = True 'iLogicVb.UpdateWhenDone = True 'ThisApplication.DocumentUpdate = True 'iLogicVb.UpdateWhenDone = True 'Parameter.UpdateAfterChange = True 'ThisApplication.ActiveDocument.Update2 'Application.Wait (Now + TimeValue("0:00:12")) ' didnt work ThisApplication.ActiveView.Update() ' didnt work ThisApplication.ActiveDocument.Rebuild ' didnt work ThisApplication.ActiveDocument.Update() 'Save .igs in new file path ThisDoc.Document.SaveAs(ThisDoc.Path + file_directory + file_name + ".obj", True) ThisDoc.Document.SaveAs(ThisDoc.Path + file_directory + file_name + ".dwg", True) GoExcel.DisplayAlerts = False GoExcel.Close 'iLogicVb.UpdateWhenDone = True
Solved! Go to Solution.