PM_CREATE_OBJECT
Syntax
handle_val = PM_CREATE_OBJECT ( object_type, object_tag_record, invalid_tag );
- Input arguments
- Output arguments
-
string invalid_tag In case of error, this output argument contains the name of the tag whose value triggered the error. This may be an empty string in case the error does not directly involve a tag.
Return Values
- Success:
-
handle object_handle Handle to the created object.
- Failure:
-
int -1 Script interface error. int MMT_E_OI_UNSUPPORTED_OBJECT_TYPE 'object_type' is not supported. int MMT_E_OI_INVALID_REFERENCE_DATA 'invalid_tag' contains a tag that has an unresolved reference. int MMT_E_OI_INVALID_GEOMETRY Object's geometry is not specified correctly. int MMT_E_OI_INVALID_DATA Some tag has an invalid value. int MMT_E_OI_UNKNOWN_DATA Unknown data in the tag record. int MMT_E_OI_MISSING_DATA Required data is missing.
Description
This function creates a new object and sets the data defined in 'object_tag_record' to the object. You must only set information that is stored to the object itself; do not attempt to set data that the object will inherit from a System, Pipeline, Attribute or Group to which it will be assigned later.
The data that you can pass to object creators is defined in %PMS_HOME%/include/pm_core_tags.h.
The maximum length of object name is defined in PM_L_OBJN in %PMS_HOME%/include/pm.h.
The error codes that the function can return are defined in %PMS_HOME%/include/pm_errors.h.
Example
%PMS_HOME%\pm\macro\Examples\CreateObject.mac