A note about this kludgy vlax-variant stuff...
Sometimes code like the following will throw an invalid index exception:
(vlax-safearray->list
(vlax-variant-value someVal)
)
It seems to happen when the safearray has no items in it, for example, if you try calling intersectWith and no intersections are found. In order to prevent the exception, you can do the following:
(setq val (vlax-variant-value someVal))
(if (safearray-value val)
(vlax-safearray->list val)
)
For some reason, the (safearray-value) function is not in the documentation. Also note that, unlike every other variant-based command, it fails to start with "vlax-".