Skip to main content

python sdk for thinkdesign

Project description

PyThinkDesign

python sdk for thinkdesign

install

pip install PyThinkDesign

usage

1. Get active TD application

if the TD application is not running, it will be created.

from PyThinkDesign import Application
app = Application.GetActiveApplication()

2. Create a TD application

from PyThinkDesign import Application
app = Application.Application();

# Set up interactive and visibility mode if necessary.
app.PutVisible(True);
app.PutInteractive(True);
app.Quit();

3. Create lines and arcs in a document

from PyThinkDesign import Application
from PyThinkDesign import Geo3d

app = Application.Application();
doc=app.GetActiveDocument();

# get creators
curveCreator=doc.GetCurveCreator();

# add lines
p1 = Geo3d.Point(0,0,0)
p2 = Geo3d.Point(1,0,0)
p3 = Geo3d.Point(1,1,0)
p4 = Geo3d.Point(0,1,0)
curveCreator.AddLine(p1,p2)
curveCreator.AddLine(p2,p3)
curveCreator.AddLine(p3,p4)
curveCreator.AddLine(p4,p1)

# add arc
pCenter = Geo3d.Point(10,0,0)
pXDir = Geo3d.Vector(1,0,0)
pYDir = Geo3d.Vector(0,1,0) 
radius = 10
startAng = 0
endAng = 60
curveCreator.AddArc(pCenter, pXDir, pYDir, radius, startAng, endAng)

# save if necessary.
#doc.SaveAs("d:\\tdApp.e3")
app.Quit();

4. List entities information in a document

from PyThinkDesign import Application
from PyThinkDesign import Geo3d

app = Application.Application();
doc=app.GetActiveDocument();

# get creators
curveCreator=doc.GetCurveCreator();

# add lines
p1 = Geo3d.Point(0,0,0)
p2 = Geo3d.Point(1,0,0)
p3 = Geo3d.Point(1,1,0)
curveCreator.AddLine(p1,p2)
curveCreator.AddLine(p2,p3)

# add arc
pCenter = Geo3d.Point(10,0,0)
pXDir = Geo3d.Vector(1,0,0)
pYDir = Geo3d.Vector(0,1,0) 
radius = 10
startAng = 0
endAng = 60
curveCreator.AddArc(pCenter, pXDir, pYDir, radius, startAng, endAng)

# get entities information
jsonStr=doc.ListInfo()
print(jsonStr)
app.Quit();

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

pythinkdesign-0.1.7.tar.gz (172.2 kB view details)

Uploaded Source

Built Distribution

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

pythinkdesign-0.1.7-py3-none-any.whl (172.4 kB view details)

Uploaded Python 3

File details

Details for the file pythinkdesign-0.1.7.tar.gz.

File metadata

  • Download URL: pythinkdesign-0.1.7.tar.gz
  • Upload date:
  • Size: 172.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pythinkdesign-0.1.7.tar.gz
Algorithm Hash digest
SHA256 7f0f2d72b3c5939ee4c5cb4089a364ebc52748dafd55bf05d647e0bd969451d7
MD5 0b08fae3297932f7710e5beb3dd06457
BLAKE2b-256 9e361e858cc49f5b0793e9a9b67d2a2b2d89e08ccc1a5fe149817ec372dc3d4e

See more details on using hashes here.

File details

Details for the file pythinkdesign-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: pythinkdesign-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 172.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pythinkdesign-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 52efec14a24f1f33f79e75bd36b1224f5332340885bf8ec147afb3d3213406b0
MD5 4e68a8a1949e159996c271b7b27be05b
BLAKE2b-256 cea3c7e902259791671db1f3af51a8a22c1cbc3200c70113c5ea1bca2db94d14

See more details on using hashes here.

Supported by

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