See the top rated post in this thread. Click here

Results 1 to 8 of 8

Thread: Save reactor with the command Annoreset

  1. #1
    Member
    Join Date
    2004-09
    Posts
    3
    Login to Give a bone
    0

    Default Save reactor with the command Annoreset

    I'm hoping someone can help me figure out why the below lisp routine doesn't work. What I'm hoping to do is every time I save/qsave a drawing the command Annoreset is run. Thanks!

    Code:
    (defun AtSaveCommand (calling-reactor b)
    (if
    (or
    (= (car b) "QSAVE")
    (= (car b) "SAVEAS")
    (= (car b) "SAVE")
    )
    (command "_.annoreset" "all" "")
    )
    )
    
    (defun loadTheSaveReactor ()
    (vl-load-com)
    (if *FileOnSave* (vlr-remove *FileOnSave*))
    (setq *FileOnSave*
    (vlr-command-reactor nil 
    '((:vlr-commandwillStart . AtSaveCommand)))
    )
    )
    (loadTheSaveReactor)
    Last edited by BlackBox; 2015-11-07 at 04:31 AM. Reason: Please use [CODE] Tags

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

    Default Re: Save reactor with the command Annoreset

    Welcome to AUGI.

    Your reactor fails for the simple reason that Visual LISP reactors do not support Command calls.

    For that, you'll have to step up to .NET or ObjectARX (C++ for AutoCAD) APIs, which can easily call Commands (with or without Editor feedback) within a given event handler.

    Cheers
    "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

  3. #3
    Member
    Join Date
    2004-09
    Posts
    3
    Login to Give a bone
    0

    Default Re: Save reactor with the command Annoreset

    BLackBox, thanks for the feedback very much appreciated although those two suggestions are above my level of expertise so I'll have to do a bit of learning to come up to speed. Any suggestions on how to proceed?

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

    Default Re: Save reactor with the command Annoreset

    Another alternative would be to write a routine that first calls ANNORESET, and then SAVE; just be sure to include an AUTOLOAD statement in addition to any CUI buttons, so user can call it from command line as well.

    Learning .NET API can be +/- a year long process before you've absorbed enough to really do what you want, when you want. If this is the path you want to go down, let me know.

    Cheers
    "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
    Member
    Join Date
    2006-12
    Location
    Cascais, Portugal
    Posts
    25
    Login to Give a bone
    1

    Default Re: Save reactor with the command Annoreset

    Hy Anthony,
    in addition to the excellent BlackBox advice, you could try to replace the command call, with a 'vla-sendcommand'
    Code:
    (defun AtSaveCommand (calling-reactor b)
    (if
    (or
    (= (car b) "QSAVE")
    (= (car b) "SAVEAS")
    (= (car b) "SAVE")
    )
    (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) (strcat "_.annoreset all \r"))
    )
    )
    Hope this helps,
    Henrique

  6. #6
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Save reactor with the command Annoreset

    You might review this thread regarding scale lists.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  7. #7
    Member
    Join Date
    2004-09
    Posts
    3
    Login to Give a bone
    0

    Default Re: Save reactor with the command Annoreset

    thanks, everyone for responding to post, for now I'll go with Henrique suggestion as it runs the annoreset command upon saving the file and therefore resolving the issue when moving a annotative block via the grips.

  8. #8
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    561
    Login to Give a bone
    0

    Default Re: Save reactor with the command Annoreset

    Have a look at this http://www.cadtutor.net/forum/showth...-radius./page3 it sends commands, note count spaces in some of the commands.

Similar Threads

  1. Command function in reactor
    By newfoundfreedom in forum AutoLISP
    Replies: 11
    Last Post: 2017-04-08, 04:36 PM
  2. command reactor selected entity
    By Serhan_BAKIR in forum AutoLISP
    Replies: 3
    Last Post: 2012-01-13, 01:10 PM
  3. ANNORESET not holding
    By kchenault in forum Dynamic Blocks - Technical
    Replies: 2
    Last Post: 2011-10-21, 01:15 PM
  4. command Reactor and condtional processing
    By rklee in forum AutoLISP
    Replies: 6
    Last Post: 2009-07-24, 11:42 AM
  5. UnKnown Command Reactor
    By kerbocad in forum VBA/COM Interop
    Replies: 8
    Last Post: 2009-01-21, 04:45 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
  •