Skip to main content

CAD-PyRx

Python for AutoCAD & Clones

CAD-PyRx is an ObjectARX module that exposes ObjectARX methods to Python, CAD-PyRx also exposes CAD's ActiveX API. Currently supported platforms are AutoCAD® 2022-2027, BricsCAD® V24-V26, GStarCAD® 2024-2026, and ZwCAD® 2024-2027

Features

  • uses wxPython for the GUI, support for Palette and Dialogs
  • degugpy to easily step through and debug your code
  • Jig, Overrule, Point monitor and other advanced tools
  • readDwgFile to open and manipulate side databases
  • import other python modules such as pandas

Installation

  • Install Python 3.14 as shown here
  • Install from PyPI (here):
    pip install cad-pyrx
  • Install from the trunk:
    python -m pip install git+https://github.com/CEXT-Dan/PyRx.git
  • Uninstall:
    python -m pip uninstall cad-pyrx

Use APPLOAD command or the startup suite to load PyRx in CAD application, example: Note: if you are using a VENV, this path may differ, it will be loacated where you installed it

_APPLOAD
%localappdata%\Programs\Python\Python312\Lib\site-packages\pyrx\RxLoaderZ26.0.zrx
or
RxLoader24.1.arx = 2022
RxLoader24.2.arx = 2023
RxLoader24.3.arx = 2024
RxLoader25.0.arx = 2025
RxLoader25.1.arx = 2026
RxLoader26.0.arx = 2027
RxLoaderV26.0.brx = BricsCAD v26

Sample

# use prefix PyRxCmd_ to define a command called doit1
def PyRxCmd_doit1():
    try:
        db = Db.curDb()
        filter = [(Db.DxfCode.kDxfStart, "LINE")]
        ps, ss = Ed.Editor.select(filter)
        if ps != Ed.PromptStatus.eOk:
            return

        lines = [Db.Line(id) for id in ss.objectIds()]
        for line in lines:
            print(line.startPoint().distanceTo(line.endPoint()))

    except Exception as err:
        traceback.print_exception(err)

# or use decorator to define a command called doit2
@Ap.Command("doit2", Ap.CmdFlags.kMODAL)
def function_setlayer():
    try:
        db = Db.curDb()
        ps, id, _ = Ed.Editor.entSel("\nSelect a line: ", Db.Line.desc())
        if ps != Ed.PromptStatus.eOk:
            return

        # all DbObjects accept an ID in the constructor
        # line is garbage collected and closed
        line = Db.Line(id, Db.OpenMode.kForWrite)
        line.setLayer("0")

    except Exception as err:
        traceback.print_exception(err)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cad_pyrx-3.1.7.5730.tar.gz (93.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cad_pyrx-3.1.7.5730-py3-none-any.whl (94.0 MB view details)

Uploaded Python 3

File details

Details for the file cad_pyrx-3.1.7.5730.tar.gz.

File metadata

  • Download URL: cad_pyrx-3.1.7.5730.tar.gz
  • Upload date:
  • Size: 93.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cad_pyrx-3.1.7.5730.tar.gz
Algorithm Hash digest
SHA256 9a11091d5c146aaa8e52cf84a85b0756e2c42924580185d5347ef036e6d25689
MD5 9159b7a1bf5f9ea773151d974af76a2e
BLAKE2b-256 a1c39f2121ac2d0615a00312e11d8c2c0b0f200f6485ece02065bd41e9ac83a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for cad_pyrx-3.1.7.5730.tar.gz:

Publisher: publish.yml on CEXT-Dan/PyRx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cad_pyrx-3.1.7.5730-py3-none-any.whl.

File metadata

  • Download URL: cad_pyrx-3.1.7.5730-py3-none-any.whl
  • Upload date:
  • Size: 94.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cad_pyrx-3.1.7.5730-py3-none-any.whl
Algorithm Hash digest
SHA256 1ebc0e05dfdc3b60d7a6c81060e351f1d8b917101df952e63c08031bc6d7bcd2
MD5 c48622a17061c91afa7ac99827b83cc7
BLAKE2b-256 7dc17bd0a24f76e55382c378646c2b7442154f10a41136e5a0ff637aa13f3600

See more details on using hashes here.

Provenance

The following attestation bundles were made for cad_pyrx-3.1.7.5730-py3-none-any.whl:

Publisher: publish.yml on CEXT-Dan/PyRx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

3.1.8.5737

1 file

This release

3.1.7.5730 This release

2 files

3.1.6.5712

2 files

3.1.5.5697

2 files

2.2.63.5628

2 files

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