Metadata-Version: 2.4
Name: PyThinkDesign
Version: 0.1.4
Summary: python sdk for thinkdesign
Author: cscad
Author-email: cscad@cscad.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.1
Requires-Dist: pywin32
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# PyThinkDesign

python sdk for thinkdesign

## install

```bash
pip install PyThinkDesign
```

## usage

### 1. Get or Create TD application
if the TD application is not running, it will be created.

```python
from PyThinkDesign import Application
app = Application.GetOrCreateApplication()
``` 

### 2. Create lines and arcs in a document

```python
import Application
import Geo3d

# get application and document
app = Application.GetOrCreateApplication()
doc = app.ActiveDocument

# get creators
curveCreator = doc.CurveCreator

#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)

#doc.SaveAs("d:\\tdApp.e3")
app.Quit()
```



