AutoCAD 2012 帮助 | ![]() |
Sorts the elements in a list according to a given compare function, and returns the element index numbers
(vl-sort-i list comparison-function)
A list containing the index values of the elements of list, sorted in the order specified by comparison-function. Duplicate elements will be retained in the result.
Sort a list of characters in descending order:
_$ (vl-sort-i '("a" "d" "f" "c") '>)
(2 1 3 0)
The sorted list order is “f” “d” “c” “a”; “f” is the 3rd element (index 2) in the original list, “d” is the 2nd element (index 1) in the list, and so on.
Sort a list of numbers in ascending order:
_$ (vl-sort-i '(3 2 1 3) '<)
(2 1 3 0)
Note that both occurrences of 3 are accounted for in the result list.
Sort a list of 2D points by Y coordinate:
_$ (vl-sort-i '((1 3) (2 2) (3 1))
(function (lambda (e1 e2)
(< (cadr e1) (cadr e2)) ) ) )
(2 1 0)
_$ (vl-sort-i
'(a d c b a)
'(lambda (s1 s2)
(< (vl-symbol-name s1) (vl-symbol-name s2)) ) )
(4 0 3 2 1)
Note that both a's are accounted for in the result list.
V Functions | ![]() | |
vector_image | ||
ver | ||
vl-acad-defun | ||
vl-acad-undefun | ||
vl-arx-import | ||
vl-bb-ref | ||
vl-bb-set | ||
vl-catch-all-apply | ||
vl-catch-all-error-message | ||
vl-catch-all-error-p | ||
vl-cmdf | ||
vl-consp | ||
vl-directory-files | ||
vl-doc-export | ||
vl-doc-import | ||
vl-doc-ref | ||
vl-doc-set | ||
vl-every | ||
vl-exit-with-error | ||
vl-exit-with-value | ||
vl-file-copy | ||
vl-file-delete | ||
vl-file-directory-p | ||
vl-file-rename | ||
vl-file-size | ||
vl-file-systime | ||
vl-filename-base | ||
vl-filename-directory | ||
vl-filename-extension | ||
vl-filename-mktemp | ||
vl-get-resource | ||
vl-list* | ||
vl-list->string | ||
vl-list-exported-functions | ||
vl-list-length | ||
vl-list-loaded-vlx | ||
vl-load-all | ||
vl-load-com | ||
vl-load-reactors | ||
vl-mkdir | ||
vl-member-if | ||
vl-member-if-not | ||
vl-position | ||
vl-prin1-to-string | ||
vl-princ-to-string | ||
vl-propagate | ||
vl-registry-delete | ||
vl-registry-descendents | ||
vl-registry-read | ||
vl-registry-write | ||
vl-remove | ||
vl-remove-if | ||
vl-remove-if-not | ||
vl-some | ||
vl-sort | ||
vl-sort-i | ||
vl-string->list | ||
vl-string-elt | ||
vl-string-left-trim | ||
vl-string-mismatch | ||
vl-string-position | ||
vl-string-right-trim | ||
vl-string-search | ||
vl-string-subst | ||
vl-string-translate | ||
vl-string-trim | ||
vl-symbol-name | ||
vl-symbol-value | ||
vl-symbolp | ||
vl-unload-vlx | ||
vl-vbaload | ||
vl-vbarun | ||
vl-vlx-loaded-p | ||
vlax-3D-point | ||
vlax-add-cmd | ||
vlax-create-object | ||
vlax-curve-getArea | ||
vlax-curve-getClosestPointTo | ||
vlax-curve-getClosestPointToProjection | ||
vlax-curve-getDistAtParam | ||
vlax-curve-getDistAtPoint | ||
vlax-curve-getEndParam | ||
vlax-curve-getEndPoint | ||
vlax-curve-getFirstDeriv | ||
vlax-curve-getParamAtDist | ||
vlax-curve-getParamAtPoint | ||
vlax-curve-getPointAtDist | ||
vlax-curve-getPointAtParam | ||
vlax-curve-getSecondDeriv | ||
vlax-curve-getStartParam | ||
vlax-curve-getStartPoint | ||
vlax-curve-isClosed | ||
vlax-curve-isPeriodic | ||
vlax-curve-isPlanar | ||
vlax-dump-object | ||
vlax-ename->vla-object | ||
vlax-erased-p | ||
vlax-for | ||
vlax-get-acad-object | ||
vlax-get-object | ||
vlax-get-or-create-object | ||
vlax-get-property | ||
vlax-import-type-library | ||
vlax-invoke-method | ||
vlax-ldata-delete | ||
vlax-ldata-get | ||
vlax-ldata-list | ||
vlax-ldata-put | ||
vlax-ldata-test | ||
vlax-make-safearray | ||
vlax-make-variant | ||
vlax-map-collection | ||
vlax-method-applicable-p | ||
vlax-object-released-p | ||
vlax-product-key | ||
vlax-property-available-p | ||
vlax-put-property | ||
vlax-read-enabled-p | ||
vlax-release-object | ||
vlax-remove-cmd | ||
vlax-safearray-fill | ||
vlax-safearray-get-dim | ||
vlax-safearray-get-element | ||
vlax-safearray-get-l-bound | ||
vlax-safearray-get-u-bound | ||
vlax-safearray-put-element | ||
vlax-safearray-type | ||
vlax-safearray->list | ||
vlax-tmatrix | ||
vlax-typeinfo-available-p | ||
vlax-variant-change-type | ||
vlax-variant-type | ||
vlax-variant-value | ||
vlax-vla-object->ename | ||
vlax-write-enabled-p | ||
vlisp-compile | ||
vlr-acdb-reactor | ||
vlr-add | ||
vlr-added-p | ||
vlr-beep-reaction | ||
vlr-command-reactor | ||
vlr-current-reaction-name | ||
vlr-data | ||
vlr-data-set | ||
vlr-deepclone-reactor | ||
vlr-docmanager-reactor | ||
vlr-dwg-reactor | ||
vlr-dxf-reactor | ||
vlr-editor-reactor | ||
vlr-insert-reactor | ||
vlr-linker-reactor | ||
vlr-lisp-reactor | ||
vlr-miscellaneous-reactor | ||
vlr-mouse-reactor | ||
vlr-notification | ||
vlr-object-reactor | ||
vlr-owner-add | ||
vlr-owner-remove | ||
vlr-owners | ||
vlr-pers | ||
vlr-pers-list | ||
vlr-pers-p | ||
vlr-pers-release | ||
vlr-reaction-name | ||
vlr-reaction-set | ||
vlr-reactions | ||
vlr-reactors | ||
vlr-remove | ||
vlr-remove-all | ||
vlr-set-notification | ||
vlr-sysvar-reactor | ||
vlr-toolbar-reactor | ||
vlr-trace-reaction | ||
vlr-type | ||
vlr-types | ||
vlr-undo-reactor | ||
vlr-wblock-reactor | ||
vlr-window-reactor | ||
vlr-xref-reactor | ||
vports |