Skip to main content

AutoCAD Automation for Python

Project description

pyautoacad - AutoCAD Automation for Python

Requires:

Optional:

Feautures:

  • Simplifies work with coordinates (3D points)

  • Efficient objects iteration (with casting to correct type)

  • Excel/csv import and export (optional)

Usage:

from pyautocad import Autocad
from pyautocad import APoint

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

p1 = APoint(0, 0)
for i in range(5):
    acad.model.AddMText(p1, 10, u'Hi!')
    p1.y += 10
p2 = APoint(0, 0)
acad.model.AddLine(p2, p2 + APoint(0, 100))

dp = APoint(10, 0)
for mtext in acad.iter_objects('MText'):
    print mtext.TextString, mtext.InsertionPoint
    mtext.InsertionPoint = APoint(mtext.InsertionPoint) + dp
    # or
    # p = APoint(mtext.InsertionPoint)
    # p.x += 10
    # mtext.InsertionPoint = p

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.0.zip (22.8 kB view hashes)

Uploaded Source

Built Distribution

pyautocad-0.1.0.win32.exe (203.9 kB view hashes)

Uploaded Source

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