Time dependent Driver activation


I have this problem in which I need to active or deactivate a driver during the simulation. So, putting a check on simulation time I want to active and deactivation a driver. I tried using #if -#else #endif and putting a check on simulation time by defining it as an output function, but it didn’t work. I think this just provides a possibility for conditional code but actually doesn’t provide the flexibility to change the code during the simulation. Is there a way to active or deactivate a driver during simulation.

I would appreciate any help in this regard.

Thank you.



Sorry but this is not possible the #if #else statements are only resolved when the model is loaded, and they can not be determined based on kinematics.

You can do it for forces but not for kinematics.

Best regards

Thanks Soren.

Just in case you know in advance what time steps the driver should be “changed” I suggest the following simple trick. Run several simulations instead of one. If total time is 1 sec, then just run e.g. 0-.4 with one driver set-up then .4-1 with another. Use the command line application if necessary.

The problem with different simulations is that every time a new simulation starts the initial conditions are reset. It is because I don’t want to change them, I was looking for time dependent driver activation.

Can’t you create “new” initial conditions that are based on the last time step of the previous simulation?

I need to load the entire model with these new conditions. This can’t be done manually as the complex human model from the repository cannot be updated for initial conditions manually. Even when I try to change the major governing angles defined in the repository models manually, the small segments which are actually dependent on them show an error in initial position. Is there a possible way to do so?

There are “initial positions”-files in the body part of the repository. These files set the r0 and A0 of each segment. You should be able to “update” them instead of messing with the “mannequin”. Though I have to admit I haven’t used this technique myself since BRep 3.

I checked the repository. There is a file named “InitialPositions.any” in arm and leg folders but the file just defines the Axes0. There is no definition of r0 in the file.

Yes, you are right. It seems like the r0 nowadays is defined in the segment definition instead (e.g. …\Arm\Seg.any). Not very convenient, but it should at least be possible to set this value using a variable that you define “outside” the body repository.

Even in Seg.any the values are not explicitly mentioned. The definition includes relationship of the segment with other segments. I don’t know how convenient and successful would this be to redefine all these position coordinates.