HyperWorks Solvers

MODSET

MODSET

Previous topic Next topic No expanding text in this topic  

MODSET

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Subroutine Type

General model data access utility subroutine.

Definition

The MODSET subroutine accesses and modifies the model data as specified in the MotionSolve XML input file.

Use

It may be called from all user-written subroutines.

Calling Syntax

Fortran

MODSET (element, id, attribute, input, info)

 

C

c_modset (element, id, attribute, input, info)

 

Python

info = py_modset (element, id, attribute, input)

 

MATLAB

info = m_modset (element, id, attribute, input)

Input Arguments

[string] ELEMENT

The name of the XML element.

[integer] ID        

The identifier of the element.

[string] ATTRIBUTE

The name of the attribute associated with the XML element.

[string] INPUT                

The value of the attribute, casted as character string.

Output Values

[integer] INFO                

The information about the call status or return value type.  A negative value indicates failure in modifying the model data.

 0

Attribute successfully modified.

-1

Element name unrecognized or unsupported.

-2

ID not found or invalid.

-3

Attribute name unrecognized or unsupported.

-4

Attribute is a non-modifiable constant character string.

         

Comments

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.

Examples

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

<Motion_Joint

    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, you may call:

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

 

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

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

 

Or, you may optionally use:

CALL SET_ATTRIBUTE('20D+sin(72D*TIME-11.537D)',INFO)

from a FORTRAN user subroutine.

See Also:

MODFNC

Data Access Subroutines