reactor query

Discussion in 'AutoCAD' started by Jamie Duncan, Mar 3, 2005.

  1. Jamie Duncan

    Jamie Duncan Guest

    Here are the two main reactors I've set up as part of our in-house system:

    ;;; Reactors
    ;;;
    ;;; resets ltscale to dimscale value
    (defun varChanged (calling-reactor varChangeinfo / var_name)
    (setq var_name (nth 0 varChangeinfo))
    (if (and (= var_name "DIMSCALE")(/= (getvar "cvport") 1))
    (setvar "ltscale" (* ARCTSCAL (getvar "dimscale")))
    )
    )
    (vlr-sysvar-reactor nil '(:)vlr-sysVarChanged . varChanged)))
    ;;; resets ltscale etc if layout space is changed
    (defun ChangedLayout (reactor layout / )
    (if (= (nth 0 layout) "Model")
    (progn
    (setvar "ltscale" (* (if (= (getvar "dimscale") 0) 1 (getvar "dimscale"))
    ARCTSCAL))
    (arctsetvar "cvport" 2)
    )
    (progn
    (setvar "ltscale" ARCTSCAL)
    (setvar "psltscale" 1)
    (arctsetvar "cvport" (getvar "cvport"))
    )
    )
    )

    (if(not *LayoutLTS*) (setq *LayoutLTS* (VLR-Miscellaneous-Reactor nil
    '(:)VLR-layoutSwitched . ChangedLayout)))))
    (princ)

    I've put these in the .mnl file - and they work although there is a strange
    error happening:

    opening a new .dwg or a .dwg that predates the reactor yields:

    ; error: no function definition: VARCHANGED
    ; error: no function definition: VARCHANGED
    ; error: no function definition: VARCHANGED
    ; error: no function definition: VARCHANGED
    ; error: no function definition: VARCHANGED
    ; error: no function definition: VARCHANGED

    AutoCAD menu utilities loaded.

    and the reactor works just fine. dwgs that have been opened and saved do
    not open with this error.

    certainly has me puzzled.
     
    Jamie Duncan, Mar 3, 2005
    #1
  2. Jamie Duncan

    deger Guest

    On Thu, 3 Mar 2005 16:45:11 -0500, "Jamie Duncan"

    Please notice the files loaded sequence of autocad. I meet the same
    question when using reactors. You must confirm the function which is
    connected with reactor loaded before reactor actived.
     
    deger, Mar 4, 2005
    #2
  3. Jamie Duncan

    deger Guest

    On Thu, 3 Mar 2005 16:45:11 -0500, "Jamie Duncan"

    Please notice the files loaded sequence of autocad. I meet the same
    question when using reactors. You must confirm the function which is
    connected with reactor loaded before reactor actived.
     
    deger, Mar 4, 2005
    #3
  4. - what AutoCAD version
    - use vlr-set-notification and 'active-document-only for your reactors.

    test with that, and let us know
     
    Luis Esquivel, Mar 4, 2005
    #4
  5. Jamie Duncan

    Jamie Duncan Guest

    Hey Luis!

    The error message doesn't appear in 2004, only 2000, and as we are finally
    moving to 2004, well I'll just chalk it up to acad 2000 reactior
    problems....
     
    Jamie Duncan, Mar 4, 2005
    #5
  6. Jamie Duncan

    Josh Guest

    I was getting similar errors on a command reactor in 2000 until I made a
    :vlr-beginclose dwg-reactor to vlr-remove the reactor. I'm going to look
    into the vlr-set-notification that Luis mentioned.
     
    Josh, Mar 4, 2005
    #6
  7. good...

    there are issues if you apply setvar in pre-version of AutoCAD 2004.... and the idea is to implement everything in active-x code (vlisp).

    Luis.
     
    Luis Esquivel, Mar 4, 2005
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.