iLogic GoExcel issue

iLogic GoExcel issue

Anonymous
Not applicable
828 Views
5 Replies
Message 1 of 6

iLogic GoExcel issue

Anonymous
Not applicable

I'm running this code to input user parameter values to a linked excel spreadsheet. When any of the values of cells B2-B6  are changed, the spreadsheet automatically runs a solver macro, which generates values in cells B19-B22.

 

The code works (eventually) but as the solver is running through all it's possibilities, the model is trying to regenerate each one which takes a long time.

Is there a way I can delay reading from the spreadsheet until the solver has produced the final result?

 

GoExcel.CellValue("3rd Party:GAS SPRING CALCULATION.xlsm", "Data Input", "B2") = casewidth
GoExcel.CellValue("B3") = casedepth
GoExcel.CellValue("B4") = caseheight
GoExcel.CellValue("B5") = glass
GoExcel.CellValue("B6") = plinthheight
    
 
openangle = GoExcel.CellValue("3rd Party:GAS SPRING CALCULATION.xlsm", "Data Input", "B19")
posA = GoExcel.CellValue("B20")
posB = GoExcel.CellValue("B21")
posC = GoExcel.CellValue("B22")

GoExcel.Save
GoExcel.Close

 

0 Likes
829 Views
5 Replies
Replies (5)
Message 2 of 6

GeorgK
Advisor
Advisor

AssemblyOptions.DeferUpdate Property

 

Description
Property that enables or disables updating assemblies when you edit components. Setting this property to True will defer updates of an assembly until the Update button is clicked or the Update method of the document is called.

 

Syntax
AssemblyOptions.DeferUpdate() As Boolean

0 Likes
Message 3 of 6

Anonymous
Not applicable

That doesn't work unfortunately, is it because the rule I'm running is in an ipt and not an assembly?

0 Likes
Message 4 of 6

MechMachineMan
Advisor
Advisor

Try adding

 

GoExcel.Application.EnableCalculation = False

 

Followed by 

 

GoExcel.Application.EnableCalculation = True

 

at the end of the code.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 5 of 6

Anonymous
Not applicable

@MechMachineMan

 

Thanks for your suggestion. I get this error:

 

Public member 'EnableCalculation' on type 'Application' not found.

 

It may be due to where I've placed the two lines, should they both be placed together at the end of the code before saving and closing the document?

 

I'm not sure what result to expect either, as I couldn't find much about the GoExcel.Application.EnableCalculation boolean online.

 

0 Likes
Message 6 of 6

MechMachineMan
Advisor
Advisor
It's excel API. It is the option you need in excel to prevent calculations.
One line at the start, one line at the end. The first line shoulf be placed
after you open the excel file with GoExcel, the next should be before you
close excel or after you are done pasting info into excel.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes