vlax-for


(vlax-for item vlaCollection [ exprA [ exprB ... ] ] )

This function evaluates each item from vlaCollection by exprA exprB ... and returns the last evaluated expression value.

Arguments

item  (string) name of a Lisp variable (not symbol)
vlaCollection  (VLA-Object) any COM collection object
exprA  (any Lisp expression) expression to be evaluated
exprB  (any Lisp expression) expression to be evaluated
::

Return

the value of the last evaluated expression (for last collection item)

Example

(vlax-for item (vla-get-layers ...) (setq name (vla-get-name item) ...)
queries for the 'Name' property of all layers

Remarks

Note : the loop variable ('item' in above sample) is a local variable to the (vlax-for ...) scope !
if 'item' is declared as global or local variable in actual (defun ...) scope, then 'item' will have its former value, after the (vlax-for ...) statement !



©  Bricsys NV. All rights reserved.