Hello everyone,
I have big problems to understand the reactor, I can not understand their logic.
I hope to understand it with your help.
At this time I wrote this code:
(defun c:test () (setq OGG1 (car (entsel))) (setq collegaReactor (vlr-object-reactor (list (vlax-ename->vla-object OGG1)) "NOMEAPP" '( ;(:vlr-erased . reactor_namedefun1) ;(:vlr-cancelled . reactor_namedefun2) (:vlr-modified . reactor_namedefun3) ;(:vlr-openedForModify . reactor_namedefun4) ) ) ) (vlr-pers collegaReactor) )
OGG1 is a polyline that I stretch using the grips.
My problem is to derive the coordinates of the first vertex of the polyline before it is modified by the operation of stretching.
I then wrote:
(defun reactor_namedefun3 (notifier-object reactor-object parameter-list / ) (if (OR (= (getvar "CMDNAMES") "STRETCH")(= (getvar "CMDNAMES") "GRIP_STRETCH")) (progn (setq OGG1 (vlax-vla-object->ename notifier-object)) (setq P (vall 10 OGG1)) ;<-------------------------------------------------------------------------- ) ) ) (defun vall (x ent)(if (/= ent nil)(cdr (assoc x (entget ent)))))
If I stretch the polyline using a vertex other than the first which has been generated "P" is correct, but if I stretch the polyline using the first vertex with which it was generated the result of P are the target coordinates.
Then i noticed that I can use with "vlr-modified" also ":vlr-copied".
:vlr-copied, in fact, is started before the change of the polyline and thus the coordinates of "P" are calculated correctly.
But if I decide to remove a vertex using the context menu that appears after selecting grips the event: vlr-copied does not start
Do you have any advice?
How can I obtain the coordinates of "P" before they are changed!?