Retrieves information about how a selection set was created
(ssnamex ss [index])
Only selection sets with entities from the current drawing's model space and paper space—not nongraphical objects or entities in other block definitions—can be retrieved by this function.
If successful, ssnamex returns the name of the entity at index, along with data describing how the entity was selected. If the index argument is not supplied, this function returns a list containing the entity names of the elements in the selection set, along with data that describes how each entity was selected. If index is negative or greater than the highest-numbered entity in the selection set, ssnamex returns nil.
The data returned by ssnamex takes the form of a list of lists containing information that describes either an entity and its selection method or a polygon used to select one or more entities. Each sublist that describes the selection of a particular entity comprises three parts: the selection method ID (an integer >= 0), the entity name of the selected entity, and selection method specific data that describes how the entity was selected.
((sel_id1 ename1 (data))(sel_id2ename2 (data)) ... )
The following table lists the selection method IDs:
Selection method IDs |
|
---|---|
ID |
Description |
0 |
Nonspecific (i.e., Last All) |
1 |
Pick |
2 |
Window or WPolygon |
3 |
Crossing or CPolygon |
4 |
Fence |
Each sublist that both describes a polygon and is used during entity selection takes the form of a polygon ID (an integer < 0), followed by point descriptions.
(polygon_idpoint_description_1point_description_n... )
Polygon ID numbering starts at -1 and each additional polygon ID is incremented by -1. Depending on the viewing location, a point is represented as one of the following: an infinite line, a ray, or a line segment. A point descriptor comprises three parts: a point descriptor ID (the type of item being described), the start point of the item, and an optional unit vector that describes either the direction in which the infinite line travels or a vector that describes the offset to the other side of the line segment.
(point_descriptor_idbase_point[unit_or_offset_vector])
The following table lists the valid point descriptor IDs:
Point descriptor IDs |
|
---|---|
ID |
Description |
0 |
Infinite line |
1 |
Ray |
2 |
Line segment |
The unit_or_offset_vector is returned when the view point is something other than 0,0,1.
The data associated with Pick (type 1) entity selections is a single point description. For example, the following record is returned for the selection of an entity picked at 1,1 in plan view of the WCS:
Command: (ssnamex ss3 0)
((1 <Entity name: 1d62da0> 0 (0 (1.0 1.0 0.0))))
The data associated with an entity selected with the Window, WPolygon, Crossing, or CPolygon method is the integer ID of the polygon that selected the entity. It is up to the application to associate the polygon identifiers and make the connection between the polygon and the entities it selected. For example, the following returns an entity selected by Crossing (note that the polygon ID is -1):
Command: (ssnamex ss4 0)
((3 <Entity name: 1d62d60> 0 -1) (-1 (0 (-1.80879 8.85536 0.0)) (0 (13.4004 8.85536 0.0)) (0 (13.4004 1.80024 0.0)) (0 (-1.80879 1.80024 0.0))))
The data associated with fence selections is a list of points and descriptions for the points where the fence and entity visually intersect. For example, the following command returns information for a nearly vertical line intersected three times by a Z-shaped fence:
Command: (ssnamex ss5 0)
((4 <Entity name: 1d62d88> 0 (0 (5.28135 6.25219 0.0) ) (0 (5.61868 2.81961 0.0) ) (0 (5.52688 3.75381 0.0) ) ) )