Scripted generation of DXF/DWG files

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Scripted generation of DXF/DWG files

Torsten Bronger
Hallöchen!

I have to prepare a lithography mask which means that there is a lot
of material on it that must be generated with for loops.  For
example, 100 very slim rectangles next do each other cannot be drawn
with the mouse, well, at least not conveniently.  ;-)

I know Python quite well and was wondering whether PythonCAD can
help me.  The machine that produces the masks needs DXF or DWG
files.  I read that PyCAD has a rudimentary own scripting language
but I'd prefer Python.  So, is it possible to say something like

import pycad
my_drawing = pycad.Drawing()
my_drawing.circle(10, 15)
for i in range(100):
    my_drawing.rectangle(5, i, 10, i+0.5)
...
my_drawing.write("mask.dxf", "dxf")

I.e., I wouldn't use the GUI at all.  Thanks for any info!

Tschö,
Torsten.

--
Torsten Bronger, aquisgrana, europa vetus
                                      Jabber ID: [hidden email]
                      (See http://ime.webhop.org for ICQ, MSN, etc.)
_______________________________________________
PythonCAD mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/pythoncad
Reply | Threaded
Open this post in threaded view
|

Re: Scripted generation of DXF/DWG files

Elfnor
Hi Torsten

I've just discovered pythoncad so I don't know if it can do what you need, but try sdxf.py by Stani (Yep the same Stani as SPE).

Avaliavle from:
https://developer.berlios.de/projects/python/

This can be used to write programs to write dxf files

cheers Elfnor


Torsten Bronger wrote
Hallöchen!

I have to prepare a lithography mask which means that there is a lot
of material on it that must be generated with for loops.  For
example, 100 very slim rectangles next do each other cannot be drawn
with the mouse, well, at least not conveniently.  ;-)