Results 1 to 6 of 6

Thread: Reactors - Persistent, LData, XData...

  1. #1
    Design Visualization Moderator stusic's Avatar
    Join Date
    2004-10
    Location
    Denver, Colorado
    Posts
    1,515
    Login to Give a bone
    0

    Default Reactors - Persistent, LData, XData...

    I have a reactor lisp that I'd like to include in *some* drawings and auto-load each time a user opens the drawing. But because I don't want to do it on all drawings, I can't add it to acaddoc.lsp. I've read persistent reactors are sketchy at best, LData is simple, but not as useful as XData.

    So my question is: What method should be used, and how do I call it?

    Thanks

  2. #2
    Active Member
    Join Date
    2005-12
    Posts
    72
    Login to Give a bone
    0

    Default Re: Reactors - Persistent, LData, XData...

    Hi,
    i am placing text entities with special layer content and height. reactor can check for this hidden text in the drawing and decide wether to run or not.

    Quote Originally Posted by stusic View Post
    I have a reactor lisp that I'd like to include in *some* drawings and auto-load each time a user opens the drawing. But because I don't want to do it on all drawings, I can't add it to acaddoc.lsp. I've read persistent reactors are sketchy at best, LData is simple, but not as useful as XData.

    So my question is: What method should be used, and how do I call it?

    Thanks

  3. #3
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: Reactors - Persistent, LData, XData...

    I use a combination of extension dictionaries and XRecords to identify what a drawing is for this type of situation. I include checks for this in the acaddoc.lsp file (technically, its somewhere else which gets called by the acaddoc.lsp...). Keep in mind that because you load a LSP file with a reactor defined in it, doesn't mean you actually need to start said reactor. So you could add a very short segment to the acaddoc.lsp in the same manner as "If drawing type X *and* reactor start function is defined/loaded, then start the reactor (Quaid)".

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Reactors - Persistent, LData, XData...

    Building on dgorsman's post, and depending on your setup, we even use our file naming convention... if vl-String-Search / WcMatch = non-Nill, load the reactor, etc..

    We're on NCS, so it makes relying on file naming convention simple, but the same concept applies to directory structure, etc..
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  5. #5
    Design Visualization Moderator stusic's Avatar
    Join Date
    2004-10
    Location
    Denver, Colorado
    Posts
    1,515
    Login to Give a bone
    0

    Default Re: Reactors - Persistent, LData, XData...

    That's good info. I use acaddoc.lsp to manage the vast majority of our drawings/lisp/standards, so being able to load the reactor in this is good news. Now that I see it can be done, I should learn how to use one

  6. #6
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Reactors - Persistent, LData, XData...

    Quote Originally Posted by stusic View Post
    Now that I see it can be done, I should learn how to use one
    Pseudo-code:
    Code:
    (vl-load-com)
    ;;;--------------------------------------------------------------------;
    ;;; start reactor function
    (defun ReactorCommand:Start ()
      (or *Reactor_Command*
          (setq *Reactor_Command*
                 (vlr-command-reactor
                   "My Command Reactor"
                   '(
                     (:vlr-commandwillstart . Callback:CommandWillStart)
                     ;;<-- other events here
                    )
                 )
          )
      )
      (prompt "\nCommand reactor loaded. ")
      (princ)
    )
    ;;;--------------------------------------------------------------------;
    ;;; CommandWillStart function
    (defun Callback:CommandWillStart (rea cmd)
    )
    ;;;--------------------------------------------------------------------;
    ;;; conditional reactor load
    (if <DrawingMatchesCriteriaExpressionHere>
      (ReactorCommand:Start)
    )
    (princ)
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. Getting rid of Ldata
    By Zoeyanne in forum AutoLISP
    Replies: 18
    Last Post: 2016-01-04, 10:09 PM
  2. Replies: 6
    Last Post: 2015-08-31, 04:05 PM
  3. LDATA errors with AutoCAD 2007
    By Opie in forum AutoLISP
    Replies: 5
    Last Post: 2007-03-30, 10:18 PM
  4. LDATA to XDATA
    By pnorman in forum AutoLISP
    Replies: 3
    Last Post: 2005-06-27, 03:06 PM
  5. Long Term outlook for LDATA
    By jrd.chapman in forum AutoLISP
    Replies: 7
    Last Post: 2005-06-27, 01:54 PM

Posting Permissions

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