Making a cell variant using the script

Hi all,

I am post-processing a layout using python scripting (FYI, the final objective is to insert test labels and extract coordinates of some instances).

I need to know how to make a cell variant from an existing array using the script. This could be done using the GUI (link). The documentation describes this for PCells; however, I am not dealing with a PCell.

I am resolving the arrays using the attached piece of code. The next step is to make a cell variant from the resolved elements. Any help is appreciated.



  • In order to create a cell variant, create a new cell and copy shapes and instances of the original cell, like this:

    variant = layout.create_cell(

    You'll then need to find the Instance object of the instance you want to modify with the variant. Once you have that, making it point to the variant is simple:

    instance_to_change.cell = variant


Sign In or Register to comment.