I am trying to invoke an active-x method based on a string:
;|;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Routine: ApplySet
Purpose: Applies a method and it's arguments to an object
Arguments: obj - vla-object to which the method is applied
Args - a list of arguments as contained in TST:Styles, above
Returns: Nothing of value
-----------------------------------------------------------------------------------------
Example 1: (ApplySet obj '("TitleSuppressed" . :vlax-false)) where obj is a tablestyle object
Results: Sets the TitleSuppressed property to false
Example 2: (ApplySet obj '("gridlineweight"
(+ acHorzBottom acHorzInside acHorzTop acVertInside acVertLeft acVertRight)
acDataRow
acLnWtByLayer
)
)
Results: Sets all datarow cell border lineweights to ByLayer
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;|;
(defun ApplySet (obj Args / strMethodName)
(setq
strMethodName (strcat "vla-set" (car Args))
MethodArgs (cdr Args)
)
(cond
((null (listp MethodArgs))
(eval (list (read strMethodName) obj MethodArgs)))
(T
(eval (append (list (read strMethodName)) (append (list obj) (cdr Args))))
)
) ;end cond
) ;end defun ApplySet
The second example runs without error (obj is a tablestyle object), though it doesn't seem to do anything.
The first example exits the routine when it tries to EVAL the function.
In both examples obj is a tablestyle object.
Two questions:
1. Why doesn't the first example complete?
2. Why doesn't the second example change the tablestyle?
With no errors on #1 I'm kind of stumped.
With the flaky object model for tablestyles I don't know if I'm doing something wrong with #2, or the object model is just broken.
Any suggestions appreciated.