int cvxCompFileSaveAs
(
svxEntPath *CompPath,   /* I: pick-path of component */
int UpdateFlag,         /* I: update flag, please see the description */
vxPath File             /* I: path name to save file (must include the new file name) */
)
/*
DESCRIPTION:
Saves the file referred by the specified component to the specified path/filename.

UpdateFlag is 0 to just update the specified component only, 1 to update all the
components refer to the same part in the same parent assembly, and -1 to update all
as cvxFileSaveAs (no prompt, save as new and replace original one).

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxFileAction
(
evxDocAction type,         /* I: action type */
svxDocActionParam *param   /* I: callback function */
)
/*
DESCRIPTION:
   Set a callback function. When processing the target file option,
the callback function will be called.
   If this function called many times with the same 'type', only
the last will take effect.
   If param->pfn is null, the original callback function, if there
exists, will be removed.
   If param->pfn isn't null, the first parameter is caller's data, it
can be null, the second parameter is actual file, the last parameter
may be null, it's used as the path for output file sometimes. lastly,
if param->pfn invokes successes, the function will return 0, else 1.

WARNING:
   If one call this function to register a callback in a dll module,
he must call this function again, with argument param set as NULL,
to unregister the callback for each action before the dll module exit.
Usually we can do this in the exit function of the dll module.

RETURN:
   1 if error, else 0.
*/
________________________________________________________________________________

int cvxFileActivate
(
vxPath Name      /* I: ZW3D file name */
)
/*
DESCRIPTION:
Activates the specified ZW3D file for editing.  The file must 
already have been opened, or it must reside in one of the
default search directories (see cvxPathAdd()).

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

void cvxFileClose (void)
/*
DESCRIPTION:
Closes the active ZW3D file, prompting the user whether to save or discard
changes before closing the file. See cvxFileClose2() for a version of this
function with more options. 
*/
________________________________________________________________________________

void cvxFileClose2 
(
vxPath Name,      /* I: file name (input NULL or empty string to close the active file) */
int Option         /* I:
                  0 - prompt whether to save or discard changes before closing file;
                  1 - automatically save changes before closing file;
                  2 - automatically discard changes before closing file; if the undo-redo
                     log references the file, undo-redo information is cleared for all files
                     in the active session.
                  3 - automatically discard changes before closing file; existing undo-redo
                     information will be kept, but will ignore the closed file; if you use this
                     option, it is on you to be certain that no harm will come from undoing or
                     redoing transactions without regard for how the closed file may have been
                     involved in them.
               */
)
/*
DESCRIPTION:
Closes the specified file, whether or not it is the active file.
The active file will remain active after the specified file is closed.
If the specified file (Name) is the active file, no attempt is made to
select another file for activation after "Name" is closed.
*/
________________________________________________________________________________

int cvxFileCustomDataDel
(
vxPath   file     /* I: ZW3D or VX file name (file[0]=0 or NULL for active file) */
)
/*
DESCRIPTION:
Delete user custom data from an existing ZW3D or VX file.
Returns 1 if error; 0 if success.
*/
________________________________________________________________________________

int cvxFileCustomDataGet
(
vxPath   file,       /* I: ZW3D or VX file name (file[0]=0 or NULL for active file) */
char     **data,     /* O: customization data */
int      *dataLength /* O: length of customization data */
)
/*
DESCRIPTION:
Get user custom data from an existing ZW3D or VX file.
The list referenced by "**data" is allocated by this function and must
be deallocated by the calling procedure by cvxMemFree() function.  A NULL
pointer is output if no data is found.

Returns 1 if error; 0 if success.
*/
________________________________________________________________________________

int cvxFileCustomDataSet
(
vxPath   file,       /* I: ZW3D or VX file name (file[0]=0 or NULL for active file) */
char     *data,      /* I: customization data */
int      dataLength  /* I: length of customization data */
)
/*
DESCRIPTION:
Set user custom data to an existing ZW3D or VX file.
Program will overwrite existing custom data if file already has custom data.

Returns 1 if error; 0 if success.
*/
________________________________________________________________________________

int cvxFileDescriptionGet
(
vxPath Name,            /* I: ZW3D or VX file name (Name[0]=0 or NULL for active file) */
vxLongName Description  /* O: object description */
)
/*
DESCRIPTION:
Gets the description of specified file.
*/
________________________________________________________________________________

void cvxFileDescriptionSet
(
vxPath Name,      /* I: ZW3D or VX file name (Name[0]=0 or NULL for active file)*/
char *Description   /* I: object description */
)
/*
DESCRIPTION:
Sets description of specified file.
*/
________________________________________________________________________________

void cvxFileDirectory
(
vxPath Dir    /* O: source directory for the active file */
)
/*
DESCRIPTION:
If the active file has been saved, the directory where it
resides is output.  Otherwise, Dir[0]=0 is output.
*/
________________________________________________________________________________

int cvxFileExport
(
evxExportType Type,   /* I: type of export */
vxPath Path,          /* I: path of export file */
void* Data            /* I: data of file */
)
/*
DESCRIPTION:
Exports the specified file to specified path.
If the Type is VX_EXPORT_TYPE_IMG, the data is defined by struct svxImgData,
else if the Type is VX_EXPORT_TYPE_PDF, the data is defined by struct svxPdfData,
else if the Type is VX_EXPORT_TYPE_GRP, the data is svxGRPData(can be ignored),
else if the Type is VX_EXPORT_TYPE_DWG, the data is svxDWGData.
else if the Type is VX_EXPORT_TYPE_IGES, the data is svxIGESData.
else if the Type is VX_EXPORT_TYPE_STEP, the data is svxSTEPData.
else if the Type is VX_EXPORT_TYPE_JT, the data is svxJTData.
else if the Type is VX_EXPORT_TYPE_PARA_TEXT, the data is svxPARAData.
else if the Type is VX_EXPORT_TYPE_PARA_BINARY, the data is svxPARAData.
else if the Type is VX_EXPORT_TYPE_CAT5_PART, the data is svxCAT5Data.
else if the Type is VX_EXPORT_TYPE_CAT5_ASM, the data is svxCAT5Data.
else if the Type is VX_EXPORT_TYPE_HTML, the data is svxHTMLData.

Return 1 if error, else 0.
*/
________________________________________________________________________________

int cvxFileImport
(
svxImportData *importData  /* I: import data of specified file */
)
/*
DESCRIPTION:
Import specified file to specified object.

You can use function cvxOpCount() before importing the file, 
and then use cvxEntNewList/cvxEntNew to get the new specified 
entities after importing the file.

Returns 1 if error; 0 if success.
*/
________________________________________________________________________________

int cvxFileImportStl
(
const char *path,    /* I: STL file path */
int *idOut           /* O: id of Imported STL Block */
)
/*
DESCRIPTION:
Import a STL file to active part.
Returns 1 if error; 0 if success.
*/
________________________________________________________________________________

void cvxFileInqActive
(
char *Name,    /* O: name of active file */
int nBytes      /* I: string size of active file name */
)
/*
DESCRIPTION:
Outputs the name of the active file.
Outputs Name[0]=0 if there is no active file.
*/
________________________________________________________________________________

int cvxFileInqAsm
(
char* Name, /* O: file name of top root object in assembly */
int nBytes  /* I: string size of file name */
)
/*
DESCRIPTION:
Outputs the file name of top root object in assembly.
Outputs "Name[0]=0" if error.
*/
________________________________________________________________________________

char cvxFileInqAssemMode()
/*
DESCRIPTION:
Get target part's assembly mode, if no target is active, return the value in configuration.

RETURN:
Return 1 if new assembly mode (version 17), else 0.
*/
________________________________________________________________________________

int cvxFileInqAssociatedList
(
int *count,          /* O: number of files in list */
vxPath ** fileList   /* O: list of files */
)
/*
DESCRIPTION:
Get associated file list with the target object.This includes
assembly component files, drawing view files, imported files (IGES,
STEP,...) and links.

The calling procedure MUST deallocate the output list with cvxMemFree.

Returns 1 if error; 0 if success.
*/
________________________________________________________________________________

void cvxFileInqOpen
(
char *Name,    /* O: name of active file */
int nBytes      /* I: string size of active file name */
)
/*
DESCRIPTION:
Outputs the name of the open file.
Outputs Name[0]=0 if there is no open file.
*/
________________________________________________________________________________

int cvxFileIsModified
(
vxPath Name,         /* I: VX or ZW3D file name */
int* Modified        /* O: 1-modified, 0-unmodified */
)
/*
DESCRIPTION:
Get modification status of the specified VX or ZW3D file.
Returns 1 if error; 0 if success.

See also cvxRootInqMod() and cvxRootInqModSinceRegen().
*/
________________________________________________________________________________

int cvxFileKeep
(
int   fKeepOpen   /* I: 1 to keep files open, 0 to let files close */
)
/*
DESCRIPTION:
Set the flag that allows files to remain open after certain functions
have accessed them.  When the cvxPartAtItemGetInFile or
cvxPartAtItemSetInFile function must open a file to access an
attribute, by default it will also close the file when that function
returns.  However, if cvxFileKeep(1) is called first,
cvxPartAtItemGetInFile and cvxPartAtItemSetInFile will leave the file
open, which makes subsequent calls more efficient when accessing other
attributes in the same file.  Calling cvxFileKeep(0) restores the
default behavior, i.e. cvxPartAtItemGetInFile and
cvxPartAtItemSetInFile will close any files that they must open.

This function does not affect files that are already open when
cvxPartAtItemGetInFile or cvxPartAtItemSetInFile is called.  Files
that are already open will remain open when accessed by those
functions, regardless of how the fKeepOpen flag is set.

This function returns the previous state of the fKeepOpen flag.  In
typical usage, the returned value should be given back to this
function the second time this function is called, which will restore
the original state of the flag. For example:

   int fOldKeepOpen = cvxFileKeep(1);
   ... multiple calls to cvxPartAtItemGetInFile or cvxPartAtItemSetInFile ...;
   cvxFileOpen(fOldKeepOpen);

See cvxFileClose, cvxFileSave, and similarly named functions to close
files that may have been opened by cvxPartAtItemGetInFile or
cvxPartAtItemSetInFile.
*/
________________________________________________________________________________

int cvxFileLoadList
(
int state,             /* I: 0 to get all loaded files; 
                             1 to get all files loaded and in use
                             2 to get all loaded but unused files */
int *count,            /* O: count of the list */
vxLongName **fileList  /* O: file list */
)
/*
DESCRIPTION:
Get the loaded file list, including front-open and background-loaded files.

The list referenced by "**fileList" is allocated by this function.
And must be deallocated by the calling procedure.

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxFileNameCheck
(
   char* fileName,    /*I/O: file name*/
   int nBytes         /*I: max size of file name*/
)
/*
DESCRIPTION:
  Check and fix name without warning messages,
  If the name contains some of \/:*?"<>|,~!@$# it is invalid,
  this function will replace those character with _ to repair it.
RETURN:
  Return 1 if the input name is OK or repaired else return 0.
*/
________________________________________________________________________________

int cvxFileNew
(
vxPath Name      /* I: ZW3D file name */
)
/*
DESCRIPTION:
Creates a new ZW3D file with the specified name and makes it active,
add root object using cvxRootAdd after creating the file. If you 
need to create a single object file, cvxFileNewSingle is recommended.

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxFileNew2
(
vxPath Name,       /* I: ZW3D file name */
char *Description  /* I: optional object description (or NULL) */
)
/*
DESCRIPTION:
This function is the same as cvxFileNew2(), but it also allows you
to assign a text string description to the new object file.  The
description must not be longer than 32 bytes, including the null-
terminator.

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxFileOpen
(
vxPath Name      /* I: ZW3D file name */
)
/*
DESCRIPTION:
Opens an existing VX or ZW3D file.  It is assumed the file resides
somewhere in the active search directories (see cvxPathAdd()).
Use cvxPathSearchFirst() to force a particular directory to
be searched first.

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

void cvxFileOpenList
(
int *count,       /* O: count of the list */
vxLongName **fileList  /* O: file list */
)
/*
DESCRIPTION:
Get all of the open file list.
The list referenced by "**fileList" is allocated by this function.
And must be deallocated by the calling procedure.
A NULL pointer is output if no data is found.
*/
________________________________________________________________________________

int cvxFilePreviewExtract
(
vxPath   SrcFile, /* I: pathname to source file */
vxPath   BmpFile  /* I/O: pathname to bitmap file to be extracted */
)
/*
DESCRIPTION:
Extract the preview bitmap from a source file.
*/
________________________________________________________________________________

int cvxFileSave
(
int Close   /* I: 1 = close file after saving it; 0 = leave it open */
)
/*
DESCRIPTION:
Saves the active ZW3D file to the location it was previously saved at.

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxFileSave2
(
int Close /* I: 1 = close file after saving it; 0 = leave it open */
)
/*
DESCRIPTION:
Saves the active ZW3D file and its relevant files to the location they were previously saved at.
Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxFileSave3
(
int Close,     /* I: 1 = close file after saving it; 0 = leave it open */
int DisPrompt,    /* I: 1 = no prompt during saving it; 0 = leave it open */
int Related    /* I: 1 = save the related files; 0 = save current file only */
)
/*
DESCRIPTION:
Saves the active file. You can control keep/close, pop-out/disable prompt and save the related files by parameters.

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxFileSaveAll()
/*
DESCRIPTION:
Saves all active ZW3D files to the specified path/filename.
Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxFileSaveAs
(
vxPath Path      /* I: pathname to save file under */
)
/*
DESCRIPTION:
Saves the active ZW3D file to the specified path/filename.
If there is prompt dialog, please use "cvxUserActionStatusSet2" to avoid interrupt.

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxFileSessionClear
(
vxLongName file   /* I: file name (file[0]=0 or NULL to clear all unused files) */
)
/*
DESCRIPTION:
Removes unused files from the cache.

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

void cvxFileTypeGet
(
int *MultiObject   /* O: 1=multi-object file; 0=single-object file */
)
/*
DESCRIPTION:
Gets flag indicating whether the active file is multi-object or
single object.
*/
________________________________________________________________________________

void cvxFileTypeSet
(
int MultiObject   /* I: 1=multi-object file; 0=single-object file */
)
/*
DESCRIPTION:
Sets flag indicating whether the active file is multi-object or
single object.
*/
________________________________________________________________________________

int cvxFileVersionGet
(
vxPath file,      /* I: full file path */
int* version      /* O: version number */
)
/*
DESCRIPTION:
Get the version of the current file. 
If file=NULL, it means return the version of the current active file.
This function will return a four digits value. 
the front two means the annual version. The last two means the upgrade.
Like: 
1800 means ZW3D 2014
1810 means ZW3D 2014 SP
1900 means ZW3D 2015
1910 means ZW3D 2015 SP
......
Returns 1 if error; 0 if success.
*/
________________________________________________________________________________

int cvxFilesSaveTo
(
int Count,              /* I: count of the files list to save */
vxLongName *FileList,   /* I: name list of files to save (only file name) */
vxPath Path             /* I: path to save files */
)
/*
DESCRIPTION:
Saves the specified files in memory saved to the specified directory. The file
name will not be changed.

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxPartSmdFlatPatternExport
(
int idFlatten,          /* I: id of flatten */
vxPath filePath,        /* I: file path */
const svxDWGData* data  /* I: data of file */
)
/*
DESCRIPTION:
Exports the specified flat pattern to specified path.
This function can only export *.dwg/*.dxf files.

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxPartSmdFlatSolidExport
(
int idFlatten,       /* I: id of flatten */
evxExportType type,  /* I: export type */
vxPath filePath,     /* I: file path */
void* data           /* I: data of file */
)
/*
DESCRIPTION:
Exports the specified flat solid to specified path.
If the Type is VX_EXPORT_TYPE_IMG, the data is defined by struct svxImgData,
else if the Type is VX_EXPORT_TYPE_PDF, the data is defined by struct svxPdfData,
else if the Type is VX_EXPORT_TYPE_GRP, the data is svxGRPData(can be ignored),
else if the Type is VX_EXPORT_TYPE_DWG, the data is svxDWGData.
else if the Type is VX_EXPORT_TYPE_IGES, the data is svxIGESData.
else if the Type is VX_EXPORT_TYPE_STEP, the data is svxSTEPData.
else if the Type is VX_EXPORT_TYPE_JT, the data is svxJTData.
else if the Type is VX_EXPORT_TYPE_PARA_TEXT, the data is svxPARAData.
else if the Type is VX_EXPORT_TYPE_PARA_BINARY, the data is svxPARAData.
else if the Type is VX_EXPORT_TYPE_CAT5_PART, the data is svxCAT5Data.
else if the Type is VX_EXPORT_TYPE_CAT5_ASM, the data is svxCAT5Data.
else if the Type is VX_EXPORT_TYPE_HTML, the data is svxHTMLData.

Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxSessionClear(void)
/*
DESCRIPTION:
Clears the active session.
Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxSessionRestore(void)
/*
DESCRIPTION:
Restores the last session backup.
Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________

int cvxSessionSave(void)
/*
DESCRIPTION:
Saves the active session.
Returns 1 if function fails; 0 if it succeeds.
*/
________________________________________________________________________________