I am not sure what i am doing wrong here but in the function below "i" is always set to 2 no matter how many attributes the block has. (setq blockobj (vlax-ename->vla-object blockent) attriblist (vla-getattributes blockobj) attriblist (vlax-variant-value attriblist) i (vlax-safearray-get-dim attriblist) ret nil ) ;_ end of setq