Author Topic: How to remove "Automation Error. Object was notifying"  (Read 2028 times)

0 Members and 1 Guest are viewing this topic.

Adesu

  • Guest
How to remove "Automation Error. Object was notifying"
« on: May 09, 2010, 12:13:35 AM »
I not never bore with reactor program, sorry.... in this case I have a little problem and can not remove "Automation Error, Object was notifying"
Any one have time to look this code and revised it,I very appreciated for your help. 
Code: [Select]
(defun c:rcc (/ c1 c2 reactor-obj vgms )
  (vl-load-com)
  (setq vgms (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))   
  (setq c1 (vla-addCircle vgms (vlax-3d-point '(0 0 0)) 5))
  (vla-put-color c1 acred)
  (setq c2 (vla-addCircle vgms (vlax-3d-point '(10 0 0)) 5))
  (vla-put-color c2 acblue)
  (setq objlst (list c1 c2))
  (setq obj-reactor (vlr-object-reactor
        objlst
        nil
        '((:vlr-modified . change-radius))))

  )   ; defun

  (defun change-radius (notifier-object obj_reactor parameter-list
/ objlist newrad)                             
  (setq objlist (vlr-owners obj-reactor))
  (setq newrad (vla-get-radius notifier-object))
  (if
    (= notifier-object (nth 0 objlist))
    (vla-put-radius (nth 1 objlist) (- 10 newrad))
    (vla-put-radius (nth 0 objlist) (- 10 newrad))
    ) ; if
  (if                                                         
    (= notifier-object (nth 1 objlst))
    (vla-put-radius (nth 0 objlist) (- 10 newrad))
    (vla-put-radius (nth 1 objlist) (- 10 newrad))
    ) ; if
  )   ; defun

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to remove "Automation Error. Object was notifying"
« Reply #1 on: May 09, 2010, 02:55:18 AM »
You are  modifying the notifier as well as the targets.

Why are you doing that ??

If you change the Layer or color or location of either circle both will decrease in radius by 10 ... is that what wou really want ??


You should also have a look at your previous thread regarding reactors ... study what we did with

(vlax-write-enabled-p
and
(vlax-read-enabled-p
and
(if (and rad (> rad 0) (/= rad (vla-get-radius vla-circle))

« Last Edit: May 09, 2010, 02:59:23 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Adesu

  • Guest
Re: How to remove "Automation Error. Object was notifying"
« Reply #2 on: May 10, 2010, 09:46:36 PM »
Hi Kerry, very sorry I late to answer, I mean if red circle radius we change,exp 3 circle blue would change become radius 7, it's work well but in command prompt display  "Automation Error. Object was notifying".
I would test as your suggest, wait it

You are  modifying the notifier as well as the targets.

Why are you doing that ??

If you change the Layer or color or location of either circle both will decrease in radius by 10 ... is that what wou really want ??


You should also have a look at your previous thread regarding reactors ... study what we did with

(vlax-write-enabled-p
and
(vlax-read-enabled-p
and
(if (and rad (> rad 0) (/= rad (vla-get-radius vla-circle))