File Copy
Creo.JS provides you with the capability of copying a file from the workspace or target folder to a location on the disk and vice-versa.
Methods Introduced:
Use the method
pfcBaseSession.CopyFileToWS() to copy a file from the disk to the workspace. The file can optionally be added as secondary content to a given workspace file. If the viewable file is added as secondary content, a dependency is created between the
Creo Parametric model and the viewable file.
Use the method
pfcBaseSession.CopyFileFromWS() to copy a file from the workspace to a location on disk.
When importing or exporting
Creo Parametric models, PTC recommends that you use methods
pfcBaseSession.ImportToCurrentWS() and
pfcBaseSession.ExportFromCurrentWS(), respectively, to perform the import or export operation. Methods that copy individual files do not traverse
Creo Parametric model dependencies, and therefore do not copy a fully retrievable set of models at the same time.
Additionally, only the methods
pfcBaseSession.ImportToCurrentWS() and
pfcBaseSession.ExportFromCurrentWS() provide full metadata exchange and support. That means
pfcBaseSession.ImportToCurrentWS() can communicate all the
Creo Parametric designated parameters, dependencies, and family table information to a PDM system while
pfcBaseSession.ExportFromCurrentWS() can update exported
Creo Parametric data with PDM system changes to designated and system parameters, dependencies, and family table information. Hence PTC recommends the use of
pfcBaseSession.CopyFileToWS() and
pfcBaseSession.CopyFileFromWS() to process only non-
Creo Parametric files.