2008-05-04 03:18 UTC
I wrote this function
and used it with success in a button callback on a palette form in 5.0.0.12,
but no joy with same form in 5.0.0.13
The control is working (verified with an (alert) stub),
and the callback works if called from the command line
Callback looks like this:
I read about the dcl_DelayedInvoke function as a supposed alternative to (command "DELAY"), but I don't see a way to try it in this context, since it requires a string as argument.
I tried passing a LISP expression as a string to dcl_DelayedInvoke, but that didn't work.
Has anyone else tried a similar callback on a palette control in 5.0.0.13?
If so, can you confirm my (lack of) results?
Any suggestions?
Project files are attached (W.I.P.)
;;blink an object on/off a specified number of times
;;accepts an ename or vla-object
(defun blink (obj times milliseconds / *error* flip-vis oldecho oldvis)
(defun *error* (msg / )
(vla-put-visible obj oldvis)
(setvar "CMDECHO" oldecho)
)
(defun flip-vis (obj / )
(if (eq :vlax-true (vla-get-visible obj))
(vla-put-visible obj :vlax-false)
(vla-put-visible obj :vlax-true))
)
(if (eq (type obj) 'ENAME) (setq obj (vlax-ename->vla-object obj)))
(setq oldecho (getvar "CMDECHO")
oldvis (vla-get-visible obj))
(setvar "CMDECHO" 0)
(repeat (* 2 times)
(progn
(flip-vis obj)
(command "delay" milliseconds)
)
)
(setvar "CMDECHO" oldecho)
(princ)
);blink
and used it with success in a button callback on a palette form in 5.0.0.12,
but no joy with same form in 5.0.0.13
The control is working (verified with an (alert) stub),
and the callback works if called from the command line
Callback looks like this:
(defun C:DimensionChecker_Palette_BlinkAll_OnClicked ()
;(alert "Function Called")
(and ss
(setq i 0)
(repeat (sslength ss)
(blink (ssname ss i) blink# duration)
(setq i (1+ i))
);repeat
);and
);defun
I read about the dcl_DelayedInvoke function as a supposed alternative to (command "DELAY"), but I don't see a way to try it in this context, since it requires a string as argument.
I tried passing a LISP expression as a string to dcl_DelayedInvoke, but that didn't work.
Has anyone else tried a similar callback on a palette control in 5.0.0.13?
If so, can you confirm my (lack of) results?
Any suggestions?
Project files are attached (W.I.P.)