Tools > Code Copilot Editor

Write Your CODE V Macros 30% Faster

with K2realm’s Code Copilot Editor

K2’s Code Copilot editor makes writing custom macros a breeze so you can spend less time writing macros and more time perfecting your designs.

Powerful Time-Saving Tools to Optimize Your Workflow

  • Syntax Helper gives you instant feedback to help you get it right the first time.
  • Line-by-Line Debugger helps you troubleshoot issues fast.
  • Project Files Manager keeps all your assets in one place for easy access when you need it.

Whether you’re a CODE V beginner or a seasoned expert, you know the value of creating your own scripts.

From generating custom distortion definitions to plotting unique aberration components, to simply looping through your fields to check aperture clearances, macros make it happen … if you have the time to write them.

Make Coding Fun Again

You deserve an editor as creative as you are, to bring your CODE V macros to life more quickly and get
more done.

K2’s Code Copilot editor gives you powerful tools like:

  • Syntax Helper – See all inputs for any function, macro or CODE V command with instant popups.
  • Line-By-Line Debugger – Get fast feedback on code logic to see if it’s working the way you want.
  • Project Files Manager Keep all related project files together, switch back and forth between projects, and all files and settings are remembered and restored.

Get Up To Speed Faster

Code Copilot’s editor and debugger are simple to learn. That means you can be up and running in less time than it takes to debug a typical macro!

Notepads are for Notes, Not Code

See how Code Copilot editor makes your life easier, one macro at a time.

Get the correct syntax and avoid time-consuming help searches

Syntax Helper

  • CODE V commands –     Get a list of relevant commands using character matching
  • Macro/function inputs –    A pop-up will show all required inputs for any CODE V macro or function, even if user defined 
  • Variables –   Auto-completion of variables is quick and avoids typos

Multicore Editor

K2’s Code Copilot editor makes your work easy and smooth:

  • NOT JUST FOR TOLERANCING, also for custom user anlayses
  • Run macro loops in parallel for faster execution
  • For example, loops over zoom, field, wavelength, surface, etc. for BSP, PSF, or other custom data can be distributed across available cores

Speed up run-times using multi-core

Additional features you can expect from K2 Extensions’ new CODE V editor:

  • Bookmarks
  • Search results with wildcards and regular expression syntax
  • Dark or light color themes
  • Standard docking window layouts

Find errors in macro logic faster with K2’s debugger

Line-by-Line Debugger

  • Step through the code line-by-line to easily see logical errors (no more WRI/RTN statements!)
  • Add watches to see the contents of any variable
  • Any CODE V command can be issued while debugging for further insights
  • Array and buffer contents are easily listed
To make it easier, there’s a special command to show full array contents in a grid format.

Project Files Manager

  • K2’s editor provides a full project management workflow
  • Quick access to project files, notes, presentations, and history of commands

    Read more

Additional time-saving editor features

See how Code Copilot editor makes your life easier with extra features.

Comment/Uncomment blocks of code

Custom bookmarks for code navigation

Collapsible loops for readability

Replace any custom user text for shortcuts (e.g. concat(), num_to_str(), loops)

Keep a collection of .seq files that you need for your design in one folder, and use another for a history of lens changes. To load or run any .seq file on your lens, just double-click.

Design changes can be documented in Word or Powerpoint. Double-click to open at any time.



Any project environment can be loaded at any time, and it also restores the directory when it was last saved. This allows users to conveniently switch between projects for different customers

Watch this 1-minute tutorial on the K2 Extensions editor / debugger feature: