How to Import/Export Class Based Objects via Script ka21A000000HYnrQAG | GE Customer Center

How to Import/Export Class Based Objects via Script


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:

  1. Firstly, save a copy of the existing project as a backup.
  2. Download the attached script
  3. Stop the project and paste the script into the /script folder of the project
  4. 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.
  5. In the Program Editor, once the script is open click on the "Start" button to run the script.
  6. A dialog box will come up with two buttons on it "Import" and "Export". On the dialog box, click on "Export"
  7. When prompted, select the .gef project file for which you want to export objects and click "Open"
  8. Enter a File name and "Save" as type .CSV (Example: Output.csv)
  9. Using Notepad, open the CSV file and make the desired changes
  10. 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.

  1. 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.
  2. When the dialog appears click on the "Import" button, and then select the project *.GEF file you want to import into.
  3. Now choose the CSV file generated earlier, and it should import in the changes.