Category Creo Parametric fundamentals, Object ProFile

Function ProFileCopyToWS


Description
Copies a file from local disk to a Windchill workspace; either as a primary document or as secondary content of an existing document in the workspace.

NOTE: The config option "dm_upload_objects" can cause an upload after each save.

Replacement in Object TOOLKIT: pfcBaseSession::CopyFileToWS
Synopsis
#include <ProUtil.h>
ProErrorProFileCopyToWS(
ProPath source_file
/* (In)
The path to the file, provided by functions such as ProFileMdlnameOpen() and ProFileMdlfiletypeOpen().
*/
ProPath target_workspace
/* (In)
The destination workspace.
*/
ProPath primary_content
/* (In)
The document which the copy will be attached to, "box7.prt" for example. Pass NULL to simply copy the file to the workspace.
*/
)
Returns
PRO_TK_NO_ERRORThe function succeeded.
PRO_TK_BAD_INPUTSOne or more inputs was invalid.
PRO_TK_INVALID_FILEAn input file was not found or improper.
PRO_TK_BAD_CONTEXTThere was a problem setting primary_content.
PRO_TK_CANT_WRITEThe workspace file is not writable.

Manual References:

  1. Data Management: Windchill Operations: File Copy
  2. Data Management: Windchill Operations: File Copy

Sample Code References:

  1. pt_wc_server ( PTWCServerPartToPView.c )
  2. pt_wc_server ( PTWCServerPartToPView.c )
  3. pt_wc_server ( PTWCServerUpdateDXF.c )