Allow Origin to finish current operations. This is useful after calling a method that triggers lengthy auto-update calculations.
VB: Function Run As Boolean
C++: bool Run
C#: bool Run
Returns true if successful else false.
'Assumes there are worksheets and matrices in current Origin session. Dim oApp As Origin.ApplicationSI Dim bb As Boolean Set oApp = GetObject("", "Origin.ApplicationSI") bb = oApp.Run()
Sub Run() Dim app As Origin.IOApplication Dim wksPage As Origin.WorksheetPage Dim wks As Origin.Worksheet Dim strPath As String Dim BookName As String app = New Origin.ApplicationSI app.Visible = Origin.MAINWND_VISIBLE.MAINWND_SHOW app.NewProject() 'create a new project to see how Run() works. strPath = app.Path(Origin.APPPATH_TYPES.APPPATH_PROGRAM) + "\\Samples\\Curve Fitting\\Single Peak Fit.ogw" If app.Load(strPath) = False Then MsgBox("Fail to load template!") Exit Sub End If wksPage = app.FindWorksheet("").Parent BookName = wksPage.Name Dim rnd As Random rnd = New Random Dim X(0 To 99) As Double Dim Y(0 To 99) As Double For i = 0 To 99 X(i) = rnd.NextDouble() Y(i) = rnd.NextDouble() Next wks = app.FindWorksheet("[" + BookName + "]" + "Data") If wks Is Nothing Then MsgBox("Can not get data worksheet!") Exit Sub End If wks.SetData(X, 0, 0) wks.SetData(Y, 0, 1) app.Run() 'Origin will do recalculation. End Sub
import OriginExt as O # assume there are worksheets and matrices in current Origin session. app = O.ApplicationSI(); app.Visible = app.MAINWND_SHOW app.Run()
8.0SR2