PyAcad 0.4.1

The Selection Set Object

acad_sset (Type: ads.ssetType)

The Python representation of an Autocad/Intellicad selection set.

Note that selection sets are only valid for the current drawing editor session, so that it usually doesn't make sense to store (pickle etc.) acad_sset objects to disk. Even more importantly, the ADS module can't allocate more than 128 selection sets at any given time. This makes it important not to store them for longer than they are really needed. Each selection set will be deallocated automatically with Autocad/Intellicad when the acad_sset object has reached a reference count of 0.

Constructor

ads.ssget([mode][p1][p2][ptlist][filter]) -> acad_sset

Returns a selection set, possibly after the user has selected a number of entities on the screen. The details are similar to the Autolisp function of the same name.

The ptlist and filter arguments are currently ignored.

Note: The interface of this function is likely to be changed to use keyword arguments in the future.

A number of other function also returns acad_sset objects.

Sequence operations

len(acad_sset)

Returns the number of entities in a selection set.

acad_sset[index]

Returns the entity at the position of index in a selection set.

Methods

acad_sset.member(acad_ename) -> boolean

Returns 1 if the entity of the acad_ename object is a member of the selection set, else 0.

acad_sset.add(acad_ename)

Adds the entity of the argument to the selection set.

acad_sset.del(acad_ename)

Removes the entity of the argument from the selection set if it previously was a member.

acad_sset.xform(mx)

Modify all entities in the selection set according to the transformation matrix mx. Mx is a nested list of 4x4 floats, specifying a transformation with uniform scaling. If mx does not do uniform scaling, or if the transformation fails for other reasons, a ValueError exception is raised.