Utility/Data Access SubroutineThe MODSET subroutine accesses and modifies the model data as specified in the MotionSolve XML input file.


It may be called from all user-written subroutines.


Fortran Calling Syntax
MODSET (element, id, attribute, input, info)
C/C++ Calling Syntax
c_modset (element, id, attribute, input, info)
Python Calling Syntax
info = py_modset (element, id, attribute, input)
MATLAB Calling Syntax
info = m_modset (element, id, attribute, input)


The name of the XML element.
The identifier of the element.
The name of the attribute associated with the XML element.
The value of the attribute, casted as character string.


The information about the call status or return value type. A negative value indicates failure in modifying the model data.
Attribute successfully modified.
Element name unrecognized or unsupported.
ID not found or invalid.
Attribute name unrecognized or unsupported.
Attribute is a non-modifiable constant character string.


To modify the attribute expr of the joint motion with id=303002 in the XML file to 2D+10D*sin(72D*TIME-11.537D):

     id                  = "303002"
     type                = "EXPRESSION"
     val_type            = "D"
     expr                = "0."
     joint_id            = "303003"
     joint_type          = "R"
     ic_disp             = "0."
     ic_vel              = "0."

From a Fortran user subroutine, call:

CALL MODSET('Motion_Joint ', 303002,'expr', '2D+10D*sin(72D*TIME-11.537D)',INFO)

To modify the same attribute again to 20D+sin(72D*TIME-11.537D), call:

CALL MODSET('Motion_Joint ', 303002,'expr', '20D+sin(72D*TIME-11.537D)',INFO)

Or, you may optionally use:


from a Fortran user subroutine.


  1. Input strings are case-insensitive.
  2. MODFNC and MODSET are both general model data access utility subroutines. The former reads ("gets") the value of the element attribute, the latter "sets" or modifies the value of the element attribute.
  3. If the input is an array, it should be concatenated as a string, in the same form as appeared in the output string from MODFNC.
  4. After MODFNC or MODSET calls, if you want to keep modifying the same attribute, you may call MODSET to access the same attribute again or optionally use SET_ATTRIBUTE (input, info) until another MODFNC or MODSET is issued. SET_ATTRIBUTE modifies the attribute accessed by the last MODFNC or MODSET call.