Is it possible to Import/Export Class based Objects from a CIMPLICITY Project?
There is no direct mechanism in the CIMPLICITY Workbench to allow for this, but it is possible to import/export class based objects via script. The script attached to this article allows for the Import/Export of Class based Objects. Note that the Class the object is derived from must already be imported into the project before doing an import of a Class Object.
The following are steps to Export a Class Object:
- Firstly, save a copy of the existing project as a backup.
- Download the attached script
- Stop the project and paste the script into the /script folder of the project
- With project stopped, Open the project in the Workbench, and navigate to "Script Engine->Scripts" and then Open the recently downloaded script obj_imp_exp_timed.bcl in the Script Editor.
- In the Program Editor, once the script is open click on the "Start" button to run the script.
- A dialog box will come up with two buttons on it "Import" and "Export". On the dialog box, click on "Export"
- When prompted, select the .gef project file for which you want to export objects and click "Open"
- Enter a File name and "Save" as type .CSV (Example: Output.csv)
- Using Notepad, open the CSV file and make the desired changes
- Using Notepad, Save the CSV file doing a File->Save
The following are steps to Import a Class Object:
Note: Make sure the project is not running prior to executing these steps. Also the object for which you are importing, must have it's Class already imported into the project or the import will not function.
- Having already gone through the steps of generating an exported Class Object. Run the same script "obj_imp_exp_timed.bcl" by open the script in the Program Editor and clicking on the "Start" button.
- When the dialog appears click on the "Import" button, and then select the project *.GEF file you want to import into.
- Now choose the CSV file generated earlier, and it should import in the changes.