Results 1 to 4 of 4

Thread: Reactor for Notification of Property Change?

  1. #1
    Member
    Join Date
    2004-03
    Posts
    27
    Login to Give a bone
    0

    Default Reactor for Notification of Property Change?

    Thanks to some of you on this forum, I have been able to write some code using reactors to be able to be notified when text is changed using one of the edit commands - thereby allowing me to change the appearance of the modified text.

    However, when the text is changed using the text's properties palette there is no notiifcaiton of the change. Is there a way to do this?

    Here's my code so far:
    Code:
    ;(trace evtobjectmodified)
    (defun evtObjectModified (objReactor lstObjectModified / objModified)
      (setq objModified (vlax-ename->vla-object (cadr lstObjectModified)))
      (if (and (wcmatch (vla-get-objectname objModified) "AcDbMText,AcDbText")
               (not blnRerun))
        (setq lstObjectsModified (cons objModified lstObjectsModified))
      )
      (princ)
    )
    ;(trace evtcommandended)
    (defun evtCommandEnded (evtCall lstCallback / cmd objModified temp tstyle)
      (setq cmd (car lstCallBack))
      (if (and lstobjectsmodified (or (= cmd "DDEDIT")
                                      (= cmd "MTEDIT")))
        (progn
    ;
    ; Disable modification reactor before modifying data.
    ; Otherwise it get called for each property change.
    ;
          (vlr-remove rxnobjectModified)   
          (setq blnRerun 'T)
          (foreach objModified lstObjectsModified
            (vla-put-color objModified 4)
            (if (= 0 (getvar "pstylemode"))
              (progn
                (vla-put-PlotStyleName objModified "HEAVY")
              ) ; end progn
            ) ; end if
    ;
    ; For "TEXT" text, change the obliquing angle
    ; For "MTEXT" text, must change styles
    ;
            (if (vlax-property-available-p objModified "ObliqueAngle")
              (vla-put-ObliqueAngle objModified 0.345)
              (progn
                (if (setq tstyle (kbs_get_oblique_style objModified))
                  (vla-put-StyleName objModified tstyle)
                ) ; end if
              ) ; end progn
            ) ; end if
          ) ; end foreach
    ;
    ; Re-enable modification reactor in order to catch next user modification
    ;
          (vlr-add rxnobjectModified)
        ) ; end progn
      ) ; end if
      (setq blnRerun nil)
      (setq lstObjectsModified nil)
      (princ)
    )
    ;
    (setq rxnObjectModified (vlr-acdb-reactor nil   '((:vlr-objectModified . evtObjectModified )))
          rxnCommandEnded   (vlr-editor-reactor nil '((:vlr-commandended   . evtCommandEnded))))
    ;
    Thanks in advance.

    Bob
    Last edited by RobertB; 2005-01-13 at 04:18 PM. Reason: Added [ code ] tags

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Reactor for Notification of Property Change?

    Nope. That is a gap in the events exposed to Visual LISP.

  3. #3
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: Reactor for Notification of Property Change?

    The combination of two reactors including a object reactor and a command ended reactor means there needs to be a command ended event. The change property dialog box doesn't fire the command ended reactor. The object reactor is firing.

    Try using a command will start reactor instead or work around the issue by triggering a vba event to effect the change.

    Peter Jamtgaard

  4. #4
    Login to Give a bone
    0

    Default Re: Reactor for Notification of Property Change?

    Quote Originally Posted by peter View Post
    The combination of two reactors including a object reactor and a command ended reactor means there needs to be a command ended event. The change property dialog box doesn't fire the command ended reactor. The object reactor is firing.

    Try using a command will start reactor instead or work around the issue by triggering a vba event to effect the change.

    Peter Jamtgaard

    My application *does* use a CommandWillStart, but changing text via the properties palette will not trigger that reactor, either. Is VBA the only route to take?

Similar Threads

  1. Notification of layer creation/change in XREFS
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 16
    Last Post: 2015-11-10, 07:26 PM
  2. Replies: 4
    Last Post: 2009-12-18, 01:06 PM
  3. View change notification
    By revit.wishlist1942 in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2008-10-27, 03:18 PM
  4. Replies: 0
    Last Post: 2008-02-08, 04:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •