reactors not reacting

Hello all,It seems that the :vlr-commandWillStart event is not fired when using the grips to move entities (a polyline vertex for example).Is this a bug or I'm doing wrong (the code works with Acad lisp and lt-extender lisp) ?ThanksPhilippe

Comments

  • Gello, Philippe,please don't worry - your code is probably safe and OK.As you noticed, your code works in LT-Extender Lisp - and Bricscad uses the SAME Lisp engine since V8.So the reason is, that Bricscad does not send this "commandWillStart" event - Acad does send these notifications, with (pseudo) command names "GRIP_STRETCH", "GRIP_MOVE","GRIP_ROTATE", "GRIP_SCALE" and "GRIP_STRETCH".I will contact the related developers to add such command notifications for grip editing in Bricscad.Many greetings

  • Hello,Thanks.Another issue : entmaking a Group does not work correctly ... the group is created ok, it is selectable, but the entities inside the group don't know that they belong to a group : they don't have the (102 . "{ACAD_REACTORS") dxf codeSo it is not possible to know which group an entity belongs to by clicking this entity..Philippe

  • Hello, Philippe,many thanks for these hints ... do you have some little Lisp code at hand here ?Of course, I will check this issue, and probably create an internal issue/bug request then.Many greetings

  • My code :(defun c:gg () (defun addGroup (entList) (setq dict (cdar (dictsearch (namedobjdict) "ACAD_GROUP")) elist (append (list '(0 . "GROUP") '(102 . "{ACAD_REACTORS") (cons 330 dict) '(102 . "}") '(100 . "AcDbGroup") '(300 . "Description") '(70 . 0) '(71 . 1) ) (mapcar '(lambda (ele) (cons 340 ele)) entList) ) ) (dictadd dict "MyGroup" (entmakex elist)) ) (setq e1 (car (entsel "\nEntity 1")) e2 (car (entsel "\nEntity 2")) ) (addGroup (list e1 e2)))Now if I do :(entget e1) , I get :((-1 . ) (0 . "LINE") (5 . "3C") (330 . ) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (62 . 256) (48 . 1.0) (284 . 0) (100 . "AcDbLine") (39 . 0.0) (10 5.97009 1.84821 0.0) (11 6.18437 3.05357 0.0) (210 0.0 0.0 1.0))but inside Acad : ((-1 . ) (0 . "LINE") (5 . "1CD") (102 . "{ACAD_REACTORS") (330 . ) (102 . "}") (330 . <Nom d'entité: 7efafcf8>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbLine") (10 1339.04 718.979 0.0) (11 1578.24 929.755 0.0) (210 0.0 0.0 1.0))There's also a problem with the DVIEW command. it doesnt work if you choose DVIEWBLOCK when prompted to select entitiesPhilippe

  • Hello Torsten,Do you have some news about this issues ?Philippe

  • Hello, Philippe,thanks for reminding me !I will try the problem today, and will keep you updated then.Many greetings

  • Dear Philippe,indeed, what you report is simply a bug :-(I will just create an internal task for our developer team to fix this asap.Here is a workaround for you :using (command "-group" ...) to create the group works correctly, all group member do have the reference to the group.In any case, when this issue has been fixed, I will post a message here.Many greetingsand many thanks for your help !

  • Hello Tortsenok, thanks. What about :vlr-commandWillStart and grips command ?Philippe

  • Hello, Philippe,the problem with missing command reactor(s) during grip edit has been added to our internal task list.So it should be solved in future versions.In any case, once solved, I will add a message here to know.Many greetings, Torsten

  • Bricscad sends a (dummy) command reactor event for "GRIP_EDIT" for any grip edit operation.So a good solution would be to add "GRIP_EDIT" to the list of commands like :(setq gripcmds (list "GRIP_EDIT" "GRIP_MOVE" ....))and inside the reactor callback check the command name against the list :(if (member cmd gripcmds) ....I hope this will help ?Many greetings, Torsten

  • Hello,I guess I'm missing something because I can't make it work ...I use the following code, but nothing happens when I move a polyline vertex using the grips..code: (defun command-will-start (reactor command-list) (print command-list) )(setq commandReactor (VLR-Command-Reactor nil '((:vlr-commandWillStart . command-will-start) ) ) )Can you give an example of a working code ?ThanksPhilippe

  • Hello, Philippe,here is my usual test code I use to verify reactors :: (defun cb (arg1 arg2) (print "--- cb ---")(print arg1)(print arg2)(print "*********")(princ))CB: (setq xxx (vlr-command-reactor nil '((:vlr-commandWillStart . cb))))#: First line defines the callback function, the second one the the reactor - I guess you know :-)Using grip edit on a line, the following text is printed to command line by the reactor callback :"--- cb ---" # ("GRIP_EDIT") "*********" Specify new point: In case you do not get any reaction at all, then I would assume that your Bricscad version is not uptodate ... as I remember, the "GRIP_EDIT" (dummy) command was added around 2 months ago ...So you might try with latest Bricscad build ?Many greetings, Torsten

  • Hello,Sorry, does not work on version 9.2.15 Pro english...Any idea ?ThanksPhilippe

  • This is my code for command counting uses :vlr-CommandEnded. But with :vlr-commandWillStart it also works in V9.

    ;; ==================================================================== ;;;; ;;;; CMDCOUNT.LSP - The program is used for testing of drafting skills ;;;; of AutoCAD users. It shows the report on quantity ;;;; of the used commands and time spent for the ;;;; test drawing. ;;;; ;;;; ==================================================================== ;;;; ;;;; Command(s) to call: STARTCMDCOUNT - start command count. ;;;; ;;;; STOPCMDCOUNT - end command count and print ;;;; the report. For example: ;;;; ;;;; ====== Command Statistic ====== ;;;; ;;;; FILLET .................... 4 ;;;; GRIP_STRETCH .............. 4 ;;;; LINE ...................... 3 ;;;; CIRCLE .................... 1 ;;;; ;;;; Commands total: 12 ;;;; Time total: 0:00:49 ;;;; ;;;; ========== End Report ========= ;;;; ;;;; ==================================================================== ;;;; ;;;; THIS PROGRAM AND PARTS OF IT MAY REPRODUCED BY ANY METHOD ON ANY ;;;; MEDIUM FOR ANY REASON. YOU CAN USE OR MODIFY THIS PROGRAM OR ;;;; PARTS OF IT ABSOLUTELY FREE. ;;;; ;;;; THIS PROGRAM PROVIDES 'AS IS' WITH ALL FAULTS AND SPECIFICALLY ;;;; DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS ;;;; FOR A PARTICULAR USE. ;;;; ;;;; ==================================================================== ;;;; ;;;; V1.2, 10th Mar 2009, Riga, Latvia ;;;; © Aleksandr Smirnov (ASMI) ;;;; For AutoCAD 2000 - 2008 (isn't tested in a next versions) ;;;; ;;;; http://www.asmitools.com ;;;; ;;;; ==================================================================== ;;(defun c:StartCmdCount() (vl-load-com) (if(not cmdcount:cmdreactor) (progn (setq cmdcount:cmdreactor (vlr-Command-Reactor nil '((:vlr-CommandEnded . CmdCountReaction)) ); end vlr-Command-Reactor cmdcount:list nil cmdcount:start (getvar "DATE") ); end setq (princ "\n<<< Command Counter now started >>> ") ); end progn (princ "\n<!> Command Counter already started <!> ") ); end if (princ) ); end of c:StartCmdCount(defun c:StopCmdCount(/ cTot eTime) (if cmdcount:list (progn (setq cmdcount:list (vl-sort cmdcount:list '(lambda(a b)(>(cdr a)(cdr b)))) cTot(apply '+(mapcar 'cdr cmdcount:list)) eTime(getvar "DATE") ); end setq (princ "\n====== Command Statistic ======\n") (foreach i cmdcount:list (princ(strcat "\n "(car i)" ")) (repeat(- 26(strlen(car i)))(princ ".")) (princ " ")(princ(itoa(cdr i))) ); end foreach (princ(strcat "\n\n Commands total: "(itoa cTot))) (princ(strcat "\n Time total: " (TotalTime cmdcount:start eTime))) (princ "\n\n========== End Report =========") (textscr) (if cmdcount:cmdreactor (progn (vlr-remove cmdcount:cmdreactor) (setq cmdcount:cmdreactor nil) ); end progn ); end if ); end progn (princ "\n<!> No command history found <!> ") ); end if (princ) ); end of c:StopCmdCount(defun TotalTime(sTime eTime / r days hours minutes seconds) (setq r (* 86400 (- eTime sTime)) days(fix (/ r 86400)) r(- r(* days 86400)) hours(fix (/ r 3600)) r(- r (* hours 3600)) minutes(fix (/ r 60)) r(- r (* minutes 60)) seconds (fix r)) (strcat(rtos hours 2 0) ":" (if(> 10.0 minutes) "0" "") (rtos minutes 2 0) ":" (if(> 10.0 seconds) "0" "") (rtos seconds 2 0)) ); end TotalTime (defun CmdCountReaction(Reac Args / cLst) (if (not (setq cLst(assoc(car Args)cmdcount:list))) (setq cmdcount:list(cons(cons(car Args) 1)cmdcount:list)) (setq cmdcount:list(subst(cons(car Args)(1+(cdr cLst))) cLst cmdcount:list)) ); end if (princ) ); end of CmdCountReaction(princ "\n[Info] http:\\\\www.AsmiTools.com [Info]")(princ "\n[Info] Type STARTCMDCOUNT to command count STOPCMDCOUNT for report. [Info]")
  • Thanks Alexander for your help, but I still have the problem : reactors work fine, but not when using a "GRIP_EDIT" command ...I guess I need to uninstall Bricscad and redo a clean install.Philippe

  • Hello Philippe,I just tried the supplied code sample and it does not trigger for a grip edit in v9.2.15 but it does with the latest beta v9.3.3Hope that helps.

  • Hi,Thanks Greg !!! I had not tried this version 3.3, it works fine...Philippe

This discussion has been closed.