I'm trying to convert a list of strings to an array that I can pass to a
.Net DLL. I get the following error:
Program error - lisp value has no coercion to VARIANT with this type:
#
when I use the following code:
(setq out (vlax-invoke-method
vbstrcls
"DrawBiFold"
$acad
fname
sc
(car mod_ins)
(cadr mod_ins)
(- unitID 1)
(gp:list->variantArray dim_list)
) ;_ end of vlax-invoke-method
) ;_ end of setq
(defun gp:list->variantArray (strList / arraySpace sArray)
; allocate space for an array of 2d points stored as doubles
(setq arraySpace (vlax-make-safearray
vlax-vbstring ; element type
(cons 0
(- (length strList) 1)
) ; array dimension
)
)
(setq sArray (vlax-safearray-fill arraySpace strList))
; return array variant
(vlax-make-variant sArray)
)
Can anyone see what I'm doing wrong?
Thanks,
Dale