Hi all,
I'm having trouble with launching my simulation using VBA code.
I created my structural simulation using the user interface and now I want to change automatically some parameters. I managed to retrieve the Simulation reference and other stuff (thanks to the 3DExperience automation help) but when I want to launch the simulation, it says that the object doesn't support the method, But it's clearly a SimulationReference
Here is my code :
Dim oEditor As Editor
Set oEditor = CATIA.ActiveEditor
' Retrieve the root SimulationReference object
Dim oProdService As PLMProductService
Set oProdService = oEditor.GetService("PLMProductService")
Dim cPLMSimEntities As PLMEntities
Set cPLMSimEntities = oProdService.EditedContent
Dim oSimulationRoot As SimulationReference
Set oSimulationRoot = cPLMSimEntities.Item(1)
Dim oScenarioManager As SimScenarioManager
Set oScenarioManager = oSimulationRoot.GetItem("SimScenarioManager")
Dim oAnalysisCases As SimAnalysisCases
Set oAnalysisCases = oScenarioManager.AnalysisCases
Dim SolidAnalysis As SimAnalysisCase
Set SolidAnalysis = oAnalysisCases.GetItem("Structural Analysis Case.1")
'Dim ShellAnalysis As SimAnalysisCase
'Set ShellAnalysis = oAnalysisCases.GetItem("Structural Analysis Case.2")
'ShellAnalysis.Update
SolidAnalysis.Update
Dim SolidStep As SimStep
Set SolidStep = SolidAnalysis.Steps.Item(1)
' Launch Simulation
Dim oExecutionService As SimExecutionService
Set oExecutionService = oEditor.GetService("SimExecutionService")
oExecutionService.BasicExecuteAll (oSimulationRoot)
Any idea ? I must say I have two structural cases but I don't think this is an issue (I tried with one alone, didn't work) Cheers, Adrien
