Skip to content

CREATE_MODELGROUP

CREATE_MODELGROUP creates a new modelgroup.

Syntax

leo-grammar
CC "Core" CREATE_MODELGROUP supermgroupid:intValue mgroupname:strValue 

#--> RESULT ecode:intValue mgroupid:intValue
CC "Core" CREATE_MODELGROUP supermgroupid:intValue mgroupname:strValue 

#--> RESULT ecode:intValue mgroupid:intValue

Parameters

  • supermgroupid (intValue) - id of the parent modelgroup (the modelgroup in which the new modelgroup should be created)
  • mgroupname (strValue) - the name of the new modelgroup

Returns

  • ecode (intValue) - Contains the error code or is 0 in case of success.
  • mgroupid (intValue) - the ID of the newly created modelgroup.

Details

See Also

DELETE_MODELGROUP

Examples

Create a new modelgroup

leo-grammar
# let the user select a parent modelgroup
CC "CoreUI" MODEL_SELECT_BOX without-models mgroup-sel

# within the selected modelgroup, create a new modelgroup
CC "Core" CREATE_MODELGROUP supermgroupid:(VAL token(mgroupids,0," "))
                            mgroupname:"MyModelgroup"

IF (ecode != 0)
{
   CC "AdoScript" INFOBOX "Error!\nModelgroup could not be created. Was the name you entered unique?"
}
# let the user select a parent modelgroup
CC "CoreUI" MODEL_SELECT_BOX without-models mgroup-sel

# within the selected modelgroup, create a new modelgroup
CC "Core" CREATE_MODELGROUP supermgroupid:(VAL token(mgroupids,0," "))
                            mgroupname:"MyModelgroup"

IF (ecode != 0)
{
   CC "AdoScript" INFOBOX "Error!\nModelgroup could not be created. Was the name you entered unique?"
}

Versions and Changes

Available since ADOxx 1.3