FeResPost Web Site                     FeResPost Online User Manual

I.6.5 Reading and writing of Groups

Method “readGroupsFromPatranSession” reads Groups from a Patran session file and returns a Hash containing the list of Groups. The keys are Group names, and the values are the Groups. The method has two arguments:

1.
A String corresponding to the name of the session file.
2.
A DataBase. This argument is optional. If it is provided, the reading method removes from the created Groups all the entities undefined in the DataBase argument.

The session file from which Groups are read is as defined in section I.1.2.1. Examples of use of the method follow:

        ...  
        h=Post::readGroupsFromPatranSession("groups.ses")  
        ...  
        h=Post::readGroupsFromPatranSession("groups.ses",DB)  
        ...

Method “writeGroupsToPatranSession” is used to save groups in a Patran session file. This method does the inverse of method “Post::readGroupsFromPatranSession”. The method has two arguments:

1.
The first argument of the method is a String containing the name of the output session file.
2.
The second argument if the list of Groups. This can be a Hash similar to the one produced by method “Post::readGroupsFromPatranSession”, or an Array of Group objects.

When the second argument is a Hash, the String keys are used as reference names for the groups. If the second argument is an Array of Groups, their names are used in the session file.

The following statements:

        ...  
        h=Post::readGroupsFromPatranSession("groups.ses")  
        ...  
        Post::writeGroupsToPatranSession("hash.ses",h)  
        Post::writeGroupsToPatranSession("values.ses",h.values)  
        ...

produce equivalent Patran session files, but the order in which the Groups are defined may differ.