Go to: Synopsis. Return value. MEL examples.

Synopsis

string[] groupObjectsByName( string $objectList[], string $token )

Given a list of strings, this procedure groups the strings into lists with the same object.

Return value

None

Arguments

Variable Name Variable Type Description
$objectListstring[]List of objects to be grouped
$tokenstringSeparator at which the object grouping is defined

MEL examples

  string $objectList[] = { "curve1.cv[1]",
                           "curve1.u[0.3]",
                           "curve3.cv[2]",
                           "curve4.cv[0]",
                           "curve1.cv[0]" };
  groupObjectsByName($objectList, ".");
  // Result : { "curve1.cv[1] curve1.u[0.3] curve1.cv[0]",
  //            "curve3.cv[2]", "curve4.cv[0]" } //

  // The token is the string that limits the object name.  Changing
  // the token gives different results.
  //
  groupObjectsByName($objectList, "[");
  // Result : { "curve1.cv[1] curve1.cv[0]", "curve1.u[0.3]",
  //            "curve3.cv[2]", "curve4.cv[0]" } //