Skip to main content

AutoCAD Automation for Python

Project description

pyautoacad - AutoCAD Automation for Python

This library aimed to simplify writing ActiveX Automation scripts for AutoCAD with Python

Requires:

Optional:

Features:

  • Simplifies work with coordinates (3D points)

  • Efficient objects iteration and searching (with casting to correct type)

  • Excel/csv/json import and export (xlrd and tablib required)

Simple usage example:

from pyautocad import Autocad, APoint


acad = Autocad()
acad.prompt("Hello, Autocad from Python\n")
print acad.doc.Name

p1 = APoint(0, 0)
p2 = APoint(50, 25)
for i in range(5):
    text = acad.model.AddText('Hi %s!' % i, p1, 2.5)
    acad.model.AddLine(p1, p2)
    acad.model.AddCircle(p1, 10)
    p1.y += 10

dp = APoint(10, 0)
for text in acad.iter_objects('Text'):
    print('text: %s at: %s' % (text.TextString, text.InsertionPoint))
    text.InsertionPoint = APoint(text.InsertionPoint) + dp

for obj in acad.iter_objects(['Circle', 'Line']):
    print(obj.ObjectName)

See more examples in source distribution.

Project details


Download files

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

Source Distribution

pyautocad-0.1.3.zip (44.8 kB view details)

Uploaded Source

Built Distribution

pyautocad-0.1.3.win32.exe (209.3 kB view details)

Uploaded Source

File details

Details for the file pyautocad-0.1.3.zip.

File metadata

  • Download URL: pyautocad-0.1.3.zip
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyautocad-0.1.3.zip
Algorithm Hash digest
SHA256 00cd186ec16989cf99c7d0961539cda38198070a7ddb5fbb91e407cfcb82968f
MD5 bba0a60a64915e3d9fb2d797f1245ad9
BLAKE2b-256 91b739b7aa023414a1d10a5c3678e0c3ed88d2a94610bf4703c58669cae3ca97

See more details on using hashes here.

File details

Details for the file pyautocad-0.1.3.win32.exe.

File metadata

File hashes

Hashes for pyautocad-0.1.3.win32.exe
Algorithm Hash digest
SHA256 58b3fa56b44f5d077241014536d6b3133ff0c0d720b9143589633341ddb8cc9e
MD5 10c60bc8fd9fa4616ba2b7a4f00d9cbd
BLAKE2b-256 8741a98b804b2a828f9e5e6f7637e660a05fa374af9c17893f0865c01b2a9239

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page