See the top rated post in this thread. Click here

Page 1 of 5 12345 LastLast
Results 1 to 10 of 42

Thread: acaddoc.lsp how do you do it?

  1. #1
    100 Club
    Join Date
    2015-09
    Posts
    154
    Login to Give a bone
    0

    Default acaddoc.lsp how do you do it?

    Hi,

    I am looking for some feedback on the use of acaddoc.lsp file

    I am looking for ideas that I may be missing that would be worth putting into my acaddoc.lsp file.

    If you have edited your acaddoc.lsp file to do several things to a drawing each time you open one, what does YOUR acaddoc.lsp file do for you?

    looking forward to any comments.

    Thanks in advance

  2. #2
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: acaddoc.lsp how do you do it?

    my file has more than 200 lines, but in main it does

    setvar
    autoload
    load
    arxload


    : ) Happy Computing !

    kennet

  3. #3
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: acaddoc.lsp how do you do it?

    mine loads discipline specific lisp routines depending on the user and what department/office they belong to.
    The discipline specific lisp routines:
    run setvar
    autoload
    load
    run automation programs

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

    Default Re: acaddoc.lsp how do you do it?

    It doesn't do much aside from loading and executing the code that does what the acaddoc.lsp "normally" does. Why do it this way? Well, we have a large number of clients and applications which don't always do the same thing the same way. To have a non-standard start-up sequence the function just needs to be redefined in the proper folder (heavy use is made of the AutoCAD search path), which overrides any previous defun for that function. Makes for very simple drag'n'drop customizing, including program upgrades.

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

    Default Re: acaddoc.lsp how do you do it?

    One thing we DO NOT do, is modify system variables. Any registry saved (or non-saved) sysvar that needs changed is done in "Acad.lsp" and drawing saved sysvars are not touched. This keeps DBMOD from being changed.
    R.K. McSwain | CAD Panacea |

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

    Default Re: acaddoc.lsp how do you do it?

    Actually, even autoload could rather be placed in ACAD.LSP. You don't need to call that for each DWG you open. The only things truly needed in the ACADDOC.LSP are modifications / loading of routines that modify the DWG automatically.

    And then as rkmcswain states, these would make each DWG edited (dbmod) whenever opened. So if you've got this type of thing inside the ACADDOC.LSP - you're always going to be asked if you want to save the DWG (even if you haven't done anything to it). There's ways of getting around this, but it's atrick and not very kosher.

  7. #7
    100 Club
    Join Date
    2015-09
    Posts
    154
    Login to Give a bone
    0

    Default Re: acaddoc.lsp how do you do it?

    Quote Originally Posted by rkmcswain View Post
    One thing we DO NOT do, is modify system variables. Any registry saved (or non-saved) sysvar that needs changed is done in "Acad.lsp" and drawing saved sysvars are not touched. This keeps DBMOD from being changed.

    The approach of setting the variables in the acad.lsp is an interesting approach, might be something to consider in the future.

    the DBMOD variable returns to 0 each time the drawing is saved........at least that is my understanding.

    In what way is this variable useful? I'll guess from a programming point of view???

    Thanks for all the comments so far.

    Does anyyone use a drawing clean up lisp file? for example when a drawing is loaded all text is swept up and put on correct layer, dimensions hatching etc? if so how do you use it, woild you keep it as separate file? giving the user the option of running it?? or would you load it to run automatically

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

    Default Re: acaddoc.lsp how do you do it?

    There is a good reason to reset *certain* variables when a new drawing is opened. Lets say a not-very-well-written LISP is being used that sets FILEDIA to 0, but doesn't change it back to 1. Having the FILEDIA forced to 1 for every drawing file would be a good catch-all, I think.

    As far as automatically processing a drawing simply by openeing it, I avoid that like the plague. Its far too easy for somebody to open the wrong file with the wrong application or client and blammo - hosed drawing. I do have standards control functions, but they are either invoked manually or called from other functions (such as getting the proper layer to put a new text on).

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

    Default Re: acaddoc.lsp how do you do it?

    Quote Originally Posted by dgorsman View Post
    There is a good reason to reset *certain* variables when a new drawing is opened. Lets say a not-very-well-written LISP is being used that sets FILEDIA to 0, but doesn't change it back to 1. Having the FILEDIA forced to 1 for every drawing file would be a good catch-all, I think.
    That is a good exception. Granted, we don't run any lisp routines here that might do this, but that's not always the case everywhere. As long as you are changing a registry-saved or non-saved system variable - then no harm done...
    R.K. McSwain | CAD Panacea |

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

    Default Re: acaddoc.lsp how do you do it?

    Quote Originally Posted by feargt View Post
    The approach of setting the variables in the acad.lsp is an interesting approach, might be something to consider in the future.
    "acad.lsp" is loaded once per session. "Acaddoc.lsp" is loaded once per drawing. That is the only difference.

    Quote Originally Posted by feargt
    the DBMOD variable returns to 0 each time the drawing is saved........at least that is my understanding.
    Correct. But if you modify the drawing by changing a drawing-saved sysvar, then DBMOD gets changed from zero and so you could simply open a drawing, look at it, and try to close it and you will get prompted to save - even though you "didn't do anything" to it...
    R.K. McSwain | CAD Panacea |

Page 1 of 5 12345 LastLast

Similar Threads

  1. acaddoc.lsp
    By ted.evans in forum AutoCAD General
    Replies: 4
    Last Post: 2010-01-22, 07:10 PM
  2. AcadDoc.lsp
    By Shizzjr in forum AutoCAD General
    Replies: 4
    Last Post: 2008-03-28, 11:19 PM
  3. ACADDOC.LSP
    By dbrownson in forum AutoLISP
    Replies: 20
    Last Post: 2008-02-06, 04:52 AM
  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
  •