Skip to content

Setup & Requirements

Python Version

LinkCAD 11 ships with an embedded Python 3.11 interpreter. No separate Python installation is required.

Plugin Location

Place Python plugin files (.py) in one of these directories:

  • User plugins: %APPDATA%\LinkCAD\plugins\
  • System plugins: <LinkCAD install dir>\plugins\

LinkCAD scans these directories on startup and registers any plugins it finds.

Accessing the Console

Open the interactive Python console from the menu:

  • View → Python Console (Ctrl+Shift+P)

The console provides full access to the linkcad package and the currently loaded drawing.

Script Editor

LinkCAD includes a built-in script editor:

  • View → Python Script Editor (Ctrl+Shift+E)
  • Run the current script with F5
  • Run the selected text with Ctrl+

Package Structure

The linkcad Python package exposes the following modules through the stable linkcad.v1 API:

ModulePurpose
linkcad.v1.pluginPlugin framework — decorators, options, base classes
linkcad.v1.dbDrawing database — cells, layers, shapes, transactions
linkcad.v1.geomGeometry primitives — points, vectors, transforms, bounds
linkcad.v1.editGeometry tasks — merge, flatten, snap, join, explode
linkcad.v1.envOptions and logging — persistent settings, event log
linkcad.v1.convFile format conversion — load and save drawings
linkcad.v1.libgraphBoolean geometry — union, intersection, difference
linkcad.v1.controllerHigh-level conversion workflow controller

API Versioning

All imports should use linkcad.v1.* submodules. This pins your script to the stable v1 API surface so it will continue to work as the LinkCAD Python API evolves:

# Recommended — pinned to v1
from linkcad.v1.db import Drawing, Cell, Layer
from linkcad.v1.geom import Point, Vector

You can check the API version at runtime:

import linkcad
print(linkcad.API_VERSION) # "v1"

Installing Additional Packages

You can install additional Python packages using pip in the LinkCAD Python environment:

import subprocess
subprocess.check_call(["pip", "install", "numpy"])