Author Topic: Reactor...  (Read 7350 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Reactor...
« on: February 28, 2005, 12:09:59 PM »
Hi,

I'm trying understand reactor...

does anyone can give me some samples with the

vlr-commandWillStart
vlr-commandEnded
vlr-commandCancelled

??

thanks.
Keep smile...

nivuahc

  • Guest
Reactor...
« Reply #1 on: February 28, 2005, 12:25:43 PM »
Sure Andrea, be glad to!

Check out this link. It has quite a bit of really great information about reactors and how they work.

Andrea

  • Water Moccasin
  • Posts: 2372
Reactor...
« Reply #2 on: February 28, 2005, 02:58:20 PM »
ok...I have made this...

for test..
but the alert box apear 4 times...WHY ???





Code: [Select]
(vl-load-com)

;*******************************************************
(vlr-command-reactor
nil '((:vlr-commandWillStart . startCommand))
)

(defun startCommand (calling-reactor startcommandInfo /)

  ;thecommandstart drgName newname)

(setq thecommandstart (nth 0 startcommandInfo))

(if (= thecommandstart "PLINE")
 (progn
 (alert "The PLINE command was activated")
 (setq thecommandstart NIL)
 )
 (setq thecommandstart NIL)
 )
))


any HELP ??
Keep smile...

Serge J. Gianolla

  • Guest
Reactor...
« Reply #3 on: February 28, 2005, 05:12:52 PM »
Tiens, au lieu de te casser la tete; regarde ici
http://www.theswamp.org/phpBB2/viewtopic.php?t=2745&highlight=reactors

Andrea

  • Water Moccasin
  • Posts: 2372
Reactor...
« Reply #4 on: February 28, 2005, 07:20:55 PM »
Quote from: Serge J. Gianolla
Tiens, au lieu de te casser la tete; regarde ici
http://www.theswamp.org/phpBB2/viewtopic.php?t=2745&highlight=reactors


Serge !!  Bon sens,,  j'étais en train de t'écrire quand j'ai vu ton post..
depuis le temp que j'essai de trouver le pourquoi du comment.....ouf !!
Je ne sais plus comment t'appeler maintenant....

Proffesseur, Maître,....ou tout simplement Dieu !! 8)


un GROS merci....
Keep smile...

nivuahc

  • Guest
Reactor...
« Reply #5 on: February 28, 2005, 07:32:08 PM »
Wow, Andrea, that's an awful lot of praise you threw out there!

Should I have answered you in French?

Serge J. Gianolla

  • Guest
Reactor...
« Reply #6 on: February 28, 2005, 09:38:16 PM »
Quote
Should I have answered you in French?

Ne soyons pas chauvin, nivuahc! :D  :lol:
Glad you enjoyed the other link. Reactors are great... when they behave!!! :oops:

Serge J. Gianolla

  • Guest
Reactor...
« Reply #7 on: February 28, 2005, 09:48:27 PM »
Quote
Je ne sais plus comment t'appeler maintenant....

Pas besoin de m'appeler, je viens tout seul. <<Marrant non! :P

daron

  • Guest
Reactor...
« Reply #8 on: February 28, 2005, 10:06:31 PM »
French??? You might try Italian, if you want them to understand it.

Andrea

  • Water Moccasin
  • Posts: 2372
Reactor...
« Reply #9 on: March 01, 2005, 09:15:31 AM »
Daron,....

ITALIAN
Parlo anche Italiano...e tù ?
in fatto...sono nato a Roma.

 8)


ENGLISH
ok now i've discover something..

The code work only with AutoCAD 2004 and Higher..
In 2002..this code is not reset back the layer..

WHY ?

FRENCH
Je ne sais pas trop pourquoi ce foutu code ne fonctionne pas bien en 2002
il ne retourne pas à la couche précédente.
Keep smile...

SMadsen

  • Guest
Reactor...
« Reply #10 on: March 01, 2005, 09:27:53 AM »
Hmmm, maybe I should start writing in Danish?

[sarcasm]But then I would probably not receive any help in an english speaking forum, would I now?[/sarcasm]

Andrea

  • Water Moccasin
  • Posts: 2372
Reactor...
« Reply #11 on: March 01, 2005, 09:33:50 AM »
ok...maybe to much work than i can't see..

but i have this code..to anable reactor...



Code: [Select]

(defun c:HTz ()
 (if (CC_find_env);;detect if some variable is set
   (progn  
  (SDC_readSfile);;read other variables
  (setq BC1r T11r
           BC1 T11
  );;redefine some variables
  (loadreactortype);;<---HERE LOAD REACTOR NOT WORKING
);;progn
);;if

(command "_DTEXT")
);;end HTz
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun loadreactortype ()
;;(alert "Reactor loaded")
(vl-load-com)
(vlr-command-reactor nil '((:vlr-commandWillStart . startCommand)))
(vlr-command-reactor nil '((:vlr-commandEnded . endCommand)))
(vlr-command-reactor nil '((:vlr-commandCancelled . cancelCommand)))
(vlr-command-reactor nil '((:vlr-commandFailed . failedCommand)))
)



Also i have made tests with alertbox....and the alertbos is shown..
but the reactor is not active..

why ? :cry:  (i'm tired)
Keep smile...

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Reactor...
« Reply #12 on: March 01, 2005, 09:54:39 AM »
Quit using "COMMAND" In reacor apps!
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

daron

  • Guest
Reactor...
« Reply #13 on: March 01, 2005, 10:30:20 AM »
To add to 7's comment. While it's bad to use command in reactors, it's even worse to use a command line that errors out to user control and doesn't take control back. Autocad needs to have control in order to react.

SMadsen

  • Guest
Reactor...
« Reply #14 on: March 01, 2005, 10:40:42 AM »
Se7en, the COMMAND is not within a callback so it's perfectly legal.

Andrea, the code you posted gives no clue to the problem, except that CC_FIND_ENV probably returns nil so that LOADREACTORTYPE will never be called.

When you get it working, I hope you are aware of the fact that the way it is written, it will add reactors each time C:HTZ is called (which can become very unpleasant).