Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: ACADDOC.LSP

  1. #1
    Active Member
    Join Date
    2007-08
    Posts
    76
    Login to Give a bone
    0

    Unhappy ACADDOC.LSP

    I am working on implementing a acaddoc.lsp at my work, i have generated this thus far and it doesnt seem to work. i have been searching through the forums, and pretty much just borrowed beginnings from other threads. well here is my code, if someone could look it over and explain to me what im doing wrong, it would be much appreciated.

    Code:
    ;;ACADDOC.LSP
    (defun-q MYSTARTUP ()
       (SETVAR "LAYEREVAL" 0)
       (SETVAR "MIRRTEXT" 0)
       (SETVAR "UCSICON" 0)
       (SETVAR "TSPACEFAC" .8125)
       (SETVAR "DIMASSOC" 2)
    (PRINC)
    )
    (setq S::STARTUP (append S::STARTUP MYSTARTUP))
    
    
    
    
    (vl-load-com)
    (vlr-editor-reactor nil '((:VLR-sysVarChanged . VTF)))
     
    (defun VTF (CALL CALLBACK)
      (if (= (strcase (car CALLBACK)) "SAVETIME")
        (progn
          (setq ALK (getvar "savetime"))
          (if (/= ALK 5)
    	(progn
    		(alert "Savetime has been changed, Resetting to 5 minutes! ")
    	  	(setvar "savetime" 5)
    	  )
    	)
          )
      )
    )
    Last edited by Opie; 2008-02-06 at 02:56 PM. Reason: [CODE] tags added, see Moderator Note

  2. #2
    Member
    Join Date
    2001-03
    Location
    St. Louis MO
    Posts
    40
    Login to Give a bone
    0

    Default Re: ACADDOC.LSP

    Not really seeing anything wrong with it. Try changing it to

    Code:
    (defun-q S::Startup ()
      (SETVAR "LAYEREVAL" 0)
      (SETVAR "MIRRTEXT" 0)
      (SETVAR "UCSICON" 0)
      (SETVAR "TSPACEFAC" .8125)
      (SETVAR "DIMASSOC" 2)
      (PRINC)
      )
    instead of the other. If you are the only one using the Startup function, then you don't need to append it to an existing one.

    Another option would be to check that AutoCAD is finding this AcadDoc and not some other. At the command line type
    (findfile "acaddoc.lsp")
    and see if the path that is returned is the same as where you are placing the file.

    CJ

    Last edited by Opie; 2008-02-06 at 02:57 PM. Reason: [CODE] tags added, see Moderator Note

  3. #3
    Active Member
    Join Date
    2007-08
    Posts
    76
    Login to Give a bone
    0

    Default Re: ACADDOC.LSP

    Autocad is linking to the correct acaddoc.lsp. so that is not the prob. however, it still does not set any variables upon startup. im sure there is some mundane detail i am missing.

    i had the code working prior to adding the startup part to it. because i was having prob's with the autosave turning off, which i have now diagnosed as happening when publish crashes. so i know that autocad knows how to find the .lsp, its just not using the first string of code.

  4. #4
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,804
    Login to Give a bone
    0

    Exclamation Re: ACADDOC.LSP

    You don't need to worry about the S::Startup function unless you are calling the (command) function.

    Also, you need a leading zero when specifying a real number (in your tspacefac setvar)

    This should do it.


    Code:
    
    ;;ACADDOC.LSP
    (vl-load-com)
    (SETVAR "LAYEREVAL" 0)
    (SETVAR "MIRRTEXT" 0)
    (SETVAR "UCSICON" 0)
    (SETVAR "TSPACEFAC" 0.8125)
    (SETVAR "DIMASSOC" 2)
    
    (vlr-editor-reactor nil '((:VLR-sysVarChanged . VTF)))
    
    (defun VTF (CALL CALLBACK)
      (if (= (strcase (car CALLBACK)) "SAVETIME")
        (progn
          (setq ALK (getvar "savetime"))
          (if (/= ALK 5)
    	(progn
    	  (alert "Savetime has been changed, Resetting to 5 minutes! "
    	  )
    	  (setvar "savetime" 5)
    	)
          )
        )
      )
    )
    
    R.K. McSwain | CAD Panacea |

  5. #5
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,804
    Login to Give a bone
    0

    Default Re: ACADDOC.LSP

    Also, are you using the VLIDE to edit your lisp code? If not, this would have pointed you to the error. You should have also seen this on the command line since it was failing here....

    error: misplaced dot on input
    R.K. McSwain | CAD Panacea |

  6. #6
    Active Member
    Join Date
    2007-08
    Posts
    76
    Login to Give a bone
    0

    Default Re: ACADDOC.LSP

    Quote Originally Posted by rkmcswain View Post
    Also, are you using the VLIDE to edit your lisp code? If not, this would have pointed you to the error. You should have also seen this on the command line since it was failing here....

    error: misplaced dot on input
    No, i haven't been using this. should i write the code in notepad then check it with the VLIDE, or do you start your lisps in VLIDE?

    EDIT: thanks for all of your guys help, it works perfectly now.
    Last edited by dbrownson; 2008-02-04 at 11:44 PM.

  7. #7
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,804
    Login to Give a bone
    0

    Lightbulb Re: ACADDOC.LSP

    Quote Originally Posted by dbrownson View Post
    No, i haven't been using this. should i write the code in notepad then check it with the VLIDE, or do you start your lisps in VLIDE?
    Use the VLIDE all the time IMO.

    Code formatter, code checker, global variable extractor, color coding, matching paren finder... can't really beat it... and there is still tons of room for improvement... too bad Autodesk is ignoring it....
    R.K. McSwain | CAD Panacea |

  8. #8
    Active Member
    Join Date
    2007-08
    Posts
    76
    Login to Give a bone
    0

    Default Re: ACADDOC.LSP

    You wouldnt happen to know the sys. variable that would be the equiv. of tspacfac for multileaders would you?

  9. #9
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: ACADDOC.LSP

    Quote Originally Posted by cj_follmer View Post
    Another option would be to check that AutoCAD is finding this AcadDoc and not some other. At the command line type
    (findfile "acaddoc.lsp")
    and see if the path that is returned is the same as where you are placing the file.
    Not exactly correct, AutoCAD loads each acaddoc.lsp file found in the support paths.

  10. #10
    AUGI Addict .T.'s Avatar
    Join Date
    2000-12
    Location
    Lost
    Posts
    1,473
    Login to Give a bone
    0

    Default Re: ACADDOC.LSP

    Quote Originally Posted by irneb View Post
    Not exactly correct, AutoCAD loads each acaddoc.lsp file found in the support paths.
    Actually, it only loads the first one it finds. Have a look THIS at rkmcswain's website.

Page 1 of 3 123 LastLast

Similar Threads

  1. where did acaddoc.lsp go?
    By cwjean76 in forum AutoLISP
    Replies: 7
    Last Post: 2010-09-22, 08:28 PM
  2. acaddoc.lsp
    By ted.evans in forum AutoCAD General
    Replies: 4
    Last Post: 2010-01-22, 07:10 PM
  3. AcadDoc.lsp
    By Shizzjr in forum AutoCAD General
    Replies: 4
    Last Post: 2008-03-28, 11:19 PM
  4. acaddoc.lsp?
    By Spanky in forum AutoLISP
    Replies: 24
    Last Post: 2008-01-27, 01:30 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
  •