AutoCAD 2012 帮助
 
ssname
 
 
 

Returns the object (entity) name of the indexed element of a selection set

(ssname ss index)

Entity names in selection sets obtained with ssget are always names of main entities. Subentities (attributes and polyline vertices) are not returned. (The entnext function allows access to them.)

Arguments

ss

A selection set.

index

An integer (or real) indicating an element in a selection set. The first element in the set has an index of zero. To access entities beyond number 32,767 in a selection set, you must supply the index argument as a real.

Return Values

An entity name, if successful. If index is negative or greater than the highest-numbered entity in the selection set, ssname returns nil.

Examples

Get the name of the first entity in a selection set:

Command: (setq ent1 (ssname ss 0))

<Entity name: 1d62d68>

Get the name of the fourth entity in a selection set:

Command: (setq ent4 (ssname ss 3))

<Entity name: 1d62d90>

To access entities beyond the number 32,767 in a selection set, you must supply the index argument as a real, as in the following example:

(setq entx (ssname sset 50843.0))
See Also

S Functions
set
set_tile
setcfg
setenv
setfunhelp
setq
setvar
setview
sin
slide_image
snvalid
sqrt
ssadd
ssdel
ssget
ssgetfirst
sslength
ssmemb
ssname
ssnamex
sssetfirst
startapp
start_dialog
start_image
start_list
strcase
strcat
strlen
subst
substr