OpenAccess Script

OpenAccess Script is a direct scripting interface to the OpenAccess library. (license key required, only available for Linux and 64bit Windows) It can be use identical to LayoutScript: just press the execute button to start it. For more details on OpenAccess Script please see http://oascript.org.

Example

#load OpenAccess Script module
import oa

# avoid the oa prefix
from oa import *

libname = "demolib"
libpath   = "/home/thies/demolib"
cellname = "pythontest"

# Open default lib.defs file
oaLibDefList.openLibs()

#check if library is already open
lib = oaLib.find(libname)

if not lib:
        # opens the library
    lib = oaLib.open(libname,libpath)
    if not lib:
        print ("Cannot find library, will be created")
        lib=oaLib.create(libname,libpath)
        if not lib:
                print ("Library cannot be created" )
                sys.exit(1)

mlay = oaViewType.get("maskLayout")
design = oaDesign.open(libname, cellname, "layout", mlay, "w")
block = oaBlock.create(design)

# add a rectangle to the design on layer 9, property 0
box=oaBox(0,0,500,800)
oaRect.create(block,9,0,box)

# add a polygon to the design on layer 11, property 0
p=oaPointArray()
p.append([145,67]);
p.append([985,244]);
p.append([335,955]);
oaPolygon.create(block,11,0,p)

design.save()

Further examples are in any LayoutEditor package under macros/examples.