mdlIObject AddSystemFromDefInMemory

Adds a system from an existing definition.

Syntax

mdlIObject_handle AddSystemFromDefInMemorynew_handle, varname, label, existing_def_name

Application

MotionView Tcl Modify

Description

This command adds a new system from an existing definition in memory. The required input to create a System from definition in memory, apart from ‘label’ and ‘varname’, is an already existing definition name (existing_def_name). The ‘existing_def_name’ should be present in memory. In other words, a System with definition name as ‘existing_def_name’ should already be added into the Model.

Inputs

new_handle
The handle of the newly created system.
varname
The variable name for the new system.
label
The label for the new system.
existing_def_name
The existing system definition name which will be used to create the new system.

Example

To add a system from an existing definition:
hwi GetSessionHandle mySessionName 
mySessionName GetProjectHandle myProjectName 
set activePageNum [myProjectName GetActivePage]
myProjectName GetPageHandle myPageName $activePageNum
set activeWinNum [myPageName GetActiveWindow]
myPageName GetWindowHandle myWindowName $activeWinNum
myWindowName GetClientHandle myClientName 
myClientName GetModelHandle myModelName 
myModelName AddSystemFromNewInlinedDef new_handle System sys_0 "\"SYSTEM 0\"" def_sys_1
myModelName AddSystemFromDefInMemory sys_handle sys_1 "\"SYSTEM 0\"" def_sys_1
sys_handle ReleaseHandle
new_handle ReleaseHandle
myModelName ReleaseHandle
myClientName ReleaseHandle
myWindowName ReleaseHandle
myPageName ReleaseHandle
myProjectName ReleaseHandle
mySessionName ReleaseHandle

Errors

Returns the handle of the newly created system if successful. If there is an error, an error code will be returned.