TOC PREV NEXT INDEX

OMcreate_obj_from_path

Synopsis


OMobj_id OMcreate_obj_from_path( const char * template_path,
const char * newobj_name, OMobj_id parent);

Description

OMcreate_obj_from_path creates an object from a template object. The template object can be any object in the Templates hierarchy. It is specified by a character string that represents the pathname to that object. The new object's name is newobj_name . The object becomes an immediate subobject of parent . The new object's default process id is the id of the calling process. If the new object is an instance, its instanced flag is set so that it will execute.OMcreate_obj_from_path is generally easier to use than its lower-level alternatives, OMcopy_obj and OMcreate_obj.

Arguments

template_path
The path name of a template object, specified as a string. Do not specify an instanced object.You specify a name just as you would in V code. Typically, this means that you can specify an unqualified name. For example:OMcreate_obj_from_path("Viewer3D", ...);OMcreate_obj_from_path("group", ...);Depending on the object, you may need to specify a pathname if the library containing the object is not global. For example, the Data Visualization Kit's module objects require the prefix MODS:OMcreate_obj_from_path("MODS.crop", ...);
newobj_name
The name of the new object, specified as a string. If you specify a null string, the Object Manager gives the new object the same name as type .OMcreate_obj_from_path ensures that the resulting name is unique within the parent specified. If necessary, the routine makes the name unique by appending the string # n.
parent
The id of the new object's parent. parent can be any object that can have subobjects, such as SingleWindowApp, Applications, or a library, group, or macro.For parent you can specify OMnull_obj. The new object is created with no parent. You can subsequently assign it a parent with OMadd_subobj.

Returned value

The id of the new object; or OMnull_obj on an error.

Examples

none.

See Also

OMcreate_obj

TOC PREV NEXT INDEX