﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2978	Modelica3d fails	Adam Dershowitz <dersh@…>	Lennart Ochel	"I have tried this with recent Mac builds, and also Linux 1.9.1 release.  
For example, just doing this in OMShell:


{{{
loadModelica3D();getErrorString();
loadString(""model DoublePendulum
  extends Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum;
  inner ModelicaServices.Modelica3D.Controller m3d_control;
end DoublePendulum;"");getErrorString();
simulate(DoublePendulum);
}}}

As suggested here:  [https://build.openmodelica.org/Documentation/OpenModelica.Scripting.loadModelica3D.html]  gives many errors (after some warnings).  The begging set of errors are here:


{{{
/usr/bin/clang        ""-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include"" -I""/opt/local/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_10asr.o DoublePendulum_10asr.c
DoublePendulum.c:195:171: error: too many arguments to function call, expected single argument 'threadData', have 3 arguments
        $Pworld$Px_label$Pcylinders$lB1$rB$Pres = omc_ModelicaServices_Modelica3D_rotate(threadData, omc_ModelicaServices_Modelica3D_State$m3d__control$state(threadData, $Pm3d_control$Pstate$Pconn, $Pm3d_control$Pstate$Pcontext), $Pworld$Px_label$Pcylinders$lB1$rB$Pid, tmp722, time);
                                                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./DoublePendulum_model.h:14499:36: note: expanded from macro '$Pm3d_control$Pstate$Pconn'
#define $Pm3d_control$Pstate$Pconn data->simulationInfo.extObjs[6]
                                   ^
./DoublePendulum_functions.h:83:1: note: 'omc_ModelicaServices_Modelica3D_State$m3d__control$state' declared here
ModelicaServices_Modelica3D_State$m3d__control$state omc_ModelicaServices_Modelica3D_State$m3d__control$state(threadData_t *threadData); /* record head */
^
/usr/bin/clang        ""-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include"" -I""/opt/local/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_11mix.o DoublePendulum_11mix.c
11 warnings generated.
/usr/bin/clang        ""-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include"" -I""/opt/local/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_12jac.o DoublePendulum_12jac.c
DoublePendulum.c:222:171: error: too many arguments to function call, expected single argument 'threadData', have 3 arguments
        $Pworld$Px_label$Pcylinders$lB1$rB$Pres = omc_ModelicaServices_Modelica3D_moveTo(threadData, omc_ModelicaServices_Modelica3D_State$m3d__control$state(threadData, $Pm3d_control$Pstate$Pconn, $Pm3d_control$Pstate$Pcontext), $Pworld$Px_label$Pcylinders$lB1$rB$Pid, tmp727, time);
                                                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./DoublePendulum_model.h:14499:36: note: expanded from macro '$Pm3d_control$Pstate$Pconn'
#define $Pm3d_control$Pstate$Pconn data->simulationInfo.extObjs[6]
                                   ^
./DoublePendulum_functions.h:83:1: note: 'omc_ModelicaServices_Modelica3D_State$m3d__control$state' declared here
ModelicaServices_Modelica3D_State$m3d__control$state omc_ModelicaServices_Modelica3D_State$m3d__control$state(threadData_t *threadData); /* record head */
^
DoublePendulum_06inz.c:77:186: error: too many arguments to function call, expected single argument 'threadData', have 3 arguments

}}}

And these keep going until reaching the ""fatal limit"":

{{{
./DoublePendulum_functions.h:83:1: note: 'omc_ModelicaServices_Modelica3D_State$m3d__control$state' declared here
ModelicaServices_Modelica3D_State$m3d__control$state omc_ModelicaServices_Modelica3D_State$m3d__control$state(threadData_t *threadData); /* record head */
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [DoublePendulum_08bnd.o] Error 1

}}}
"	defect	closed	high	1.9.2	Backend	trunk	fixed		
