File Copy
Creo Object TOOLKIT Java 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
pfcSession.BaseSession.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 model and the viewable file.
Use the method
pfcSession.BaseSession.CopyFileFromWS to copy a file from the workspace to a location on disk.
When importing or exporting
Creo models, PTC recommends that you use methods
pfcSession.BaseSession.ImportToCurrentWS and
pfcSession.BaseSession.ExportFromCurrentWS, respectively, to perform the import or export operation. Methods that copy individual files do not traverse
Creo model dependencies, and therefore do not copy a fully retrievable set of models at the same time.
Additionally, only the methods
pfcSession.BaseSession.ImportToCurrentWS and
pfcSession.BaseSession.ExportFromCurrentWS provide full metadata exchange and support. That means
pfcSession.BaseSession.ImportToCurrentWS can communicate all the
Creo designated parameters, dependencies, and family table information to a PDM system while
pfcSession.BaseSession.ExportFromCurrentWS can update exported
Creo data with PDM system changes to designated and system parameters, dependencies, and family table information. Hence PTC recommends the use of
pfcSession.BaseSession.CopyFileToWS and
pfcSession.BaseSession.CopyFileFromWS to process only non-
Creo files.