mdlIObject SaveOnly

Saves the object.

Syntax

mdlIObject_handle SaveOnlyoption

Application

MotionView Tcl Modify

Description

This command saves the data or definition to the same file which was used to create an Assembly. This function should mainly be used on an Assembly. If it is used with Model, it will save the Model irrespective of the option argument.

Inputs

option
The valid values are:
DATA
Saves data only.
DEFINITON
Saves definition only.
DATA_AND_DEFINITON
Saves both data and definition.

Example

To save the data or definition to the same file which was used to create an Assembly:
Note: Copy the slider_crank.mdl model file into the present working directory before running this example.
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 GetObjectHandle obj_handle
obj_handle AddNewAssembly assem_handle assem_0 "\"Assembly 0\"" C:/temp/data_file.mdl C:/temp/def_file.mdl true assem_def_name assem_type; 
assem_handle InterpretEntity en Point p_0 "\"Point 0\""
en ReleaseHandle
assem_handle SaveOnly DEFINITION
obj_handle ReleaseHandle;
myModelName ReleaseHandle
myClientName ReleaseHandle
myWindowName ReleaseHandle
myPageName ReleaseHandle
myProjectName ReleaseHandle
mySessionName ReleaseHandle

Errors

Returns 0 if successful, otherwise an error code.