Adding References

Cognex Designer scripting is based on C# .NET, thus functions can be called from external .NET libraries.

  1. When you are editing a script, go to the Properties tool windows and click the ... button to edit the references.

  2. This opens the Script References dialog, as shown below:

  • Project References: Displays a list of all the DLLs that are referenced in the project, for all scripts in the project.
  • Local References: Displays a list of all the DLLs the script being currently edited references.
  • Discovered References: Provides a list of the common DLLs that can be referenced.
  • The Add File button allows the user to add custom .NET DLLs/assemblies that are not contained in the Discovered References list. An Open File dialog will be opened, where you can navigate to the desired DLL/assembly file.
Note: When an external reference is added to a script, it will be loaded into the application. If you change the external reference (e.g. add a new type to the custom DLL, or change an existing type), the changes will not be reflected until Designer is restarted.