Entity Selection
The functions and constants in this section are defined directly in the ads module.
Entity and selection set related functions not found here are most likely implemented as methods of the acad_ename and acad_sset objects.
Selection Set Functions
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.
Sets the selected and gripped entities on screen. The parameters are two acad_sset objects. The entities in grip_set are given grips, the entities in pickfirst_set are selected, but not gripped. The function raises a ValueException if any entitiy is in both sets at the same time.
Do not call this function when Autocad/Intellicad is in the middle of executing a builtin command.
Entity Name Functions
Pauses for user input, and returns a list of an acad_ename object and a point (a list of three reals). This is the point that was used to select the entity. The optional string argument specifies a string that entsel() displays before it pauses. If it is omitted, AutoCAD displays the "Select objects" default prompt. If no entity was selected, None is returned. If the user cancels the operation with <ctrl-C> or <Escape>, a KeyboardInterrupt exception is raised.
When the user responds to entsel() by specifying a complex entity, it returns the polyline or block header. This differs from the function nentselp(), which returns the nearest block attribute or polyline vertex.
A prior call to initget() can also enable a string return value.
nentselp([prompt | point]) -> (acad_ename, point, xform, elist)
This function is very similar entsel() but returns additional data for nested entities and allows the program to specify the pick point. If the point argument is given, nentselp will not prompt the user to select an entity, but will use the specified point as if the user had picked it on screen.
For non-complex toplevel entities, the data returned is identical to that from entsel(). For entities nested in block references or subentities of complex entities, the subentity is returned, and nentselp() additionally returns the entity's transformation matrix xform (a nested list of 4x4 reals), and the names of the entity's container blocks in elist (a list of acad_ename objects). The matrix can be used to transform any points retreived from the entity to world coordinates. The entity list holds the names of all complex entities and blocks the selected entity is nested in, starting at the deepest nesting level, and ending with the toplevel insert entity.
Please refer to the documentation of the Autolisp function (nentselp) for details on how to use the matrix and nesting information.
Finds the entity with the specified handle (a string representation of an integer number) and returns it as an acad_ename object. Handles must be turned on in the current drawing. The function will find entities that have been deleted during the current editing session. Such entities can be undeleted with the delete() method of the acad_ename object, which works as a toggle.
If the handle is not valid or it's entity can't be found in the database, a ValueError exception is raised.
Creates an entity according to the information in assoc_list and inserts it in the entity database, or any of the symbol tables depending on the type of the entity. If the created entity is the ENDBLK of a block definition, the name of the new block is returned.
Please refer to the specification of the ads_entmake()/AcDbEntmake() function in the ADS/ARX documentation or the (entmake) function in the Autolisp documentation for the possibilities and limitations when creating entities.