Hi
I'm trying to set the variable GRIDUNIT via (vla-setvariable *doc* "GRIDUNIT" ...)
although (type (getvar "GRIDUNIT")) returns LIST, whatever I try to construct a list
(for example, (setq GRID (list 1.0 1.0)) or '( 1.0 1.0) )
I always get an error back:
error: lisp value has no coercion to VARIANT with this type: (1.0 1.0)
Any idea ?
Regards
Patrick
There are 2 ways to invoke a method:
(vla-method <vla-object> argument1 ... )
(vlax-invoke <vla-object> method argument1..)
In your case, use one of the following:
(vla-setvariable *doc* "GRIDUNIT" (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1) ) (list 1.0 1.0) ) ) )
or
(vlax-invoke *doc* 'setvariable "GRIDUNIT" (list 2.0 2.0))
Maybe there's some reason behind the scenes that you need to involve all those VL... elements [the document, invoking a method, possibly variant & safearray], but if not, you could simply do this:
(setvar 'gridunit '(1 1))