MATLAB Answers


Run multiple CSI SAP2000 files in parallel not in sucsession!

Asked by Seyedfarid Ghahari on 2 Mar 2017
Latest activity Edited by Seyedfarid Ghahari on 2 Mar 2017
I know how to call and run single SAP2000 file from Matlab. However, I would like to call and run multiple SAP files at the same time. Of course I can do this manually by starting several SAP files and running them, but I do not know how to this from Matlab. Matlab runs each line and waits to receive response, so it does not run second SAP file, while first one is still running. The only solution is to assign each run to a unique core. But, I get error! Here is what I have written for single SAP2000 file:
clear ProgramPath = 'C:\Program Files\Computers and Structures\SAP2000 19\SAP2000.exe'; APIDLLPath = 'C:\Program Files\Computers and Structures\SAP2000 19\sap2000v19.dll'; ModelName = 'Model.sdb'; a = NET.addAssembly(APIDLLPath); helper = SAP2000v19.Helper; helper = NET.explicitCast(helper,'SAP2000v19.cHelper'); SapObject = helper.CreateObject(ProgramPath); SapObject = NET.explicitCast(SapObject,'SAP2000v19.cOAPI'); helper = 0; SapObject.ApplicationStart; SapObject.Hide; SapModel = NET.explicitCast(SapObject.SapModel,'SAP2000v19.cSapModel'); File = NET.explicitCast(SapModel.File,'SAP2000v19.cFile'); File.OpenFile(ModelName); Analyze = NET.explicitCast(SapModel.Analyze,'SAP2000v19.cAnalyze'); SapModel.SetModelIsLocked(false); Analyze.RunAnalysis();


Sign in to comment.

0 Answers