Skip to main content

opencad2d

OpenCAD2D for Python: commands and tools inside the OpenCAD2D app, driving a running app from outside, and drawings without a window (a CadDocument edited through its command session and saved), on the core library GeometryHelper (2D and 3D geometry, DXF and DWG read and write). The library is the .NET one, run on pythonnet; the .NET names stay as they are, and the wheel carries stubs so an editor (Pylance, pyright) completes them.

Install

Windows, 64-bit, Python 3.11 to 3.15, and a .NET 8 (or later) runtime or .NET Framework 4.8:

pip install opencad2d[numpy]

The numpy extra is for opencad2d.arrays, which copies point arrays to and from numpy in one block.

Example

import opencad2d
from OpenCAD2D import CadCommandSession, CadDocument
from GeometryHelper.Dxf import DxfDatabase, DxfWriter

document = CadDocument.From(DxfDatabase.Parse(DxfWriter().ToString()))
session = CadCommandSession(document)
with opencad2d.undo_group(document, "A circle"):  # one undo step, or none if the block raises
    for line in ("CIRCLE", "0,0", "25"):
        session.Feed(line)
document.SaveAs("drawing.dwg")
print(document.EntityCount, opencad2d.__version__, opencad2d.runtime())

The runtime is chosen by the environment variable OPENCAD2D_RUNTIME: auto (the default: .NET 8 or later when it is installed, else .NET Framework), coreclr or netfx.

The guide, with the runtime choice, the numpy helpers and the stubs, is at https://nguyenthanguth.github.io/opencad2d/.

Metadata

Release files for opencad2d 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for opencad2d 2.1.0
File Interpreter ABI Platform Actions
opencad2d-2.1.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for opencad2d-2.1.0-py3-none-win_amd64.whl

Release files / opencad2d-2.1.0-py3-none-win_amd64.whl

Download URL opencad2d-2.1.0-py3-none-win_amd64.whl
Size 16.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
238e39c06e3d3092a67cc2c80869a78c599228f8140ca68242e904394b1f09e0
BLAKE2b-256 checksum
How to use checksums
621854f9340faf49da7eb392410a06e2bbe20f531f66ce92fe1142043c99c7e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for opencad2d 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for opencad2d-2.1.0-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page