Results 1 to 5 of 5

Thread: LSP Autocaddoc.lsp help

  1. #1
    Member
    Join Date
    2013-07
    Location
    Michigan The cold tundra
    Posts
    36
    Login to Give a bone
    0

    Default LSP Autocaddoc.lsp help

    Happy Holidays everyone!

    So it has been a while since I have had to use a lisp. Like 10 years. I don't remember much because I never mastered the art of writing my own lisp routines. My first job autocad we had a guy at our company and he could do anything with a lisp just short of fixing me eggs and bacon every morning. I really miss that guy. Especially now when I am eyeballs deep in project that I know could be light work with the help of a simple routine. So here is what I need.

    I have the routine written.


    SETQ reply (ACET-UI-MESSAGE "WARNING: THIS DRAWING IS CURRENTLY BEING UPDATED, DO NOT MAKE CHANGES"
    "Warning"
    (+ Acet:OK Acet:ICONWarning)
    )
    )

    Here it is. I need it to pop up everytime a drawing is open from a specific folder. So I understand that I need to use a autocaddoc.lsp. But how to I make one? Or where can I find it? Once I do find it and put my routine in where do I save it? Basically I need a step by step instruction.

    Step 1: open or create this
    Step 2: write this
    Step 3: Save here
    Step 4: do this to see if it works.

    Thanks.

  2. #2
    Active Member
    Join Date
    2013-07
    Posts
    66
    Login to Give a bone
    0

    Default Re: LSP Autocaddoc.lsp help

    Well, here's how I would do it....
    I'm a fledgling, take this for what it's worth, and i'm not sure that's too much but alas...

    (getvar "dwgprefix")
    "C:\\Users\\bhull\\Documents"

    That's how you can check from within a drawing if it's in that folder of dwgs being updated.

    You would find the acaddoc.lsp file in the support directory it's something like crogram files/autodesk/autocad/support

    That file is MODIFIED, as in, double click on it, it brings up notepad or asks you which program to use to open that file. Tell it notepad.
    You would include portions of code that

    Code:
    (setq path "C:\\Where\\Your\\Folder\\Is\\")               ;set a variable 'path' to contain your path information
    (if (= (getvar "dwgprefix") path)                               ;if the value returned by (getvar "dwgprefix") is equal to that of your path variable
    (alert "WARNING: THIS DRAWING IS CURRENTLY BEING UPDATED, DO NOT MAKE CHANGES")         ;alert method alternative to yours above
    )                                                                            ;close if
    You could put this within the acaddoc.lsp file that's *ALREADY ON YOUR MACHINE* it comes with every autocad already there.
    Open it, put that within it.
    You will need to ensure that this is checked so that your system is set to load acaddoc.lspop.jpg
    LISPINIT=1
    that's a system variable

    I'm not as experienced as many others but I hope that helps you get what you were looking for

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

    Default Re: LSP Autocaddoc.lsp help

    acad.lsp and acaddoc.lsp do not come with any current installation of AutoCAD. Those two files are user created and controlled. You can read more about AutoCAD customization on R.K. McSwain's site.
    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

  4. #4
    Member
    Join Date
    2013-07
    Location
    Michigan The cold tundra
    Posts
    36
    Login to Give a bone
    0

    Default Re: LSP Autocaddoc.lsp help

    Thanks for all the help!! I found the lsp's in the support file but I do not have one named acaddoc.lsp... I have one named acad2014lsp. Once I find that file do I copy it into the C:\CADSTUFF? Where in the lsp would I put my routine?

  5. #5
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: LSP Autocaddoc.lsp help

    Quote Originally Posted by jande43 View Post
    Thanks for all the help!! I found the lsp's in the support file but I do not have one named acaddoc.lsp... I have one named acad2014lsp. Once I find that file do I copy it into the C:\CADSTUFF? Where in the lsp would I put my routine?
    Check out Opie's link about acaddoc.lsp. DON'T modify acad2014lsp! Delete the copy you made. It belongs to Autodesk and may be replaced the next time you install a service pack or hot fix.

    Acad.lsp, acaddoc.lsp & acad.rx are files that do not install with AutoCAD, but are designed to autorun to make it easy to add custom code like what you want to do. You can use any ASCII editor to create any of these files.

    Learn to use findfile.
    Code:
     (findfile "acaddoc.lsp")
    &
    Code:
     (findfile "acad.lsp")
    will find those files if they are in the support path, if they aren't in the support path they wont run anyway. I would recommend not having acad.lsp load with every drawing. Any code that needs to be loaded with every drawing should be in acaddoc.lsp, code that only needs to be loaded once per session should be in acad.lsp. No advantage in having both files behave exactly the same way.
    Last edited by Tom Beauford; 2014-01-03 at 12:34 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
  •