PyAcad 0.4.1

Entity Creation Utilities

Those utility functions can be imported from the module acadmake.py. The series is still incomplete at the moment.

Functions

Keyword arguments that default to None will use system defaults if not set. All functions listed here accept the following keyword arguments, unless otherwise noted:
layer=None The layer name of the entity. If the layer doesn't exist, it will be crated.
color=None The color of the entity.
ltype=None The linetype of the entity.
ltscale=None The linetype scale of the entity.
invisible=None The invisibility status of the entity.
zdir=(0.0, 0.0, 1.0) The normal vector of the entity.
make_point(point,
    angle=0.0,
    thickness=0.0,
)

Create a POINT entity.

make_line(point0, point1,
    thickness=0.0,
)

Create a LINE entity.

make_circle(point, radius,
    thickness=0.0,
)

Create a CIRCLE entity.

make_pline(
    thickness=0.0,
    elevation=0.0,
    flags=0,
    startw=None,
    endw=None,
)

Create a POLYLINE entity. This function must be followed by at least two calls to make_vertex(), and a call to end_seq(), before any other function of this series or an unrelated call to entmake() is made. Otherwise, Autocad/Intellicad will ignore the information it has received so far through this and following functions.

Compatibility note: Up to Pyacad 0.4.1, this function required a useless "name" argument in the first position.

make_vertex(point,
    bulge=0.0,
    angle=0.0,
    startw=None,
    endw=None
)

Create a VERTEX entity. Vertexes must be created between a call of make_pline() and end_seq(), or they will result in an exception thrown by pyacad.
This function accepts no further arguments.

end_seq()

Commit the creation of a POLYLINE after a call to make_pline() and several calls to make_vertex().
This function accepts no arguments.

make_block(name,
    point=(0.0,0.0,0.0),
    flags=0,
)

Create a BLOCK entity. This function may be followed by calls to other entity creation functions. The block definition will be commited by a call to end_block(). The entities defined between the calls to make_block() and end_block() will be part of the block definition, which can then be inserted into the drawing by make_insert(). Calls to make_block() may not be nested.
This function accepts no other arguments.

make_attdef(point, tag, prompt,
    default=None,
    flags=0,
    height=0.0,
    xscale=1.0,
    angle=0.0,
    slant=0.0,
)

Create an ATTDEF entity. ATTDEFs are only useful within BLOCK definitions.

end_block()

Commit the creation of a BLOCK definition.
This function accepts no arguments.

make_insert(name, point,
    xscale=1.0,
    yscale=1.0,
    zscale=1.0,
    angle=0.0,
    attflag=0,
)

Create an INSERT entity.