kotvkvante / stuff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

material written by me for me

ac_utils.py: some functions for generating AutoCAD scripts

Example:

In your project:

git clone https://github.com/kotvkvante/stuff

Then:

from stuff import ac_utils as ac

xs = [-5, -4 -3, -2, -1, 0, 1, 2, 3, 4, 5]
ys = [x**2 for x in xs]

# One line:

ac.ac_write_to_file(
        [ac.AC_PLINE_COMMAND],
        [xs, ys],
        output_file ="my_script_1" 
    )

# Multiple lines:

y3 = [x**3 for x in xs]
yx = [x for x in xs]

ac.ac_write_to_file(
	[ac.AC_SPLINE_COMMAND, ac.AC_SPLINE_COMMAND, ac.AC_SPLINE_COMMAND],
        [xs, ys], 
	[xs, y3], 
	[xs, yx],
        output_file="my_script_2"
    )

Note

Disable "Object Snaps" in AutoCAD before run generated script.

About


Languages

Language:Python 100.0%