See the top rated post in this thread. Click here

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

Thread: Batch/Script automation of Autocad

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

    Default Batch/Script automation of Autocad

    Here is the scenario...
    I have a directory with many drawings. Autocad dwg files are being updated and added to this directory all the time. I would like to completely automate the following task: open all files one at a time, run the command "overkill" on each, save then exit. I would like the entire task to run unattended at night. I also do not want to select the drawings in the directory manually.

    I have created a batch command that will open each drawing within the directory one at at time but I do not know how to run overkill command once a drawing has been opened.

    I have also created a working script file that runs overkill, saves then exits but I do not know how to run this script from the batch file or send the command to Autocad after the drawing has been opened.

    Does anyone have any thoughts?

    Thanks,

    Jason

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

    Lightbulb Re: Batch/Script automation of Autocad

    There are many scripting programs out there.

    Autodesk has a free one called ScriptPro
    http://www.autodesk.com/migrationtools

    Not sure about getting this to just up and run by itself in the middle of the night. It may need a human to kick it off. Let us know what you find....
    R.K. McSwain | CAD Panacea |

  3. #3
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: Batch/Script automation of Autocad

    Quote Originally Posted by jason.145418 View Post
    Here is the scenario...
    I have a directory with many drawings. Autocad dwg files are being updated and added to this directory all the time. I would like to completely automate the following task: open all files one at a time, run the command "overkill" on each, save then exit. I would like the entire task to run unattended at night. I also do not want to select the drawings in the directory manually.

    I have created a batch command that will open each drawing within the directory one at at time but I do not know how to run overkill command once a drawing has been opened.

    I have also created a working script file that runs overkill, saves then exits but I do not know how to run this script from the batch file or send the command to Autocad after the drawing has been opened.

    Does anyone have any thoughts?

    Thanks,

    Jason

    Give this a try , you will need to check and add the OVERKILL options .
    Attached Files Attached Files

  4. #4
    Member
    Join Date
    2007-08
    Posts
    7
    Login to Give a bone
    0

    Default Re: Batch/Script automation of Autocad

    rkmcswain: Thanks for the suggestions so far...
    I did try scriptpro and it does most of what I would like to accomplish but as you mentioned, needs some maual input. It requries me to add drawings that I would like to perform my actions on. I would like this list of drawings to update automatically.

    devitg.89838: Thanks for the lisp routine. I had a quick look at the code and I must say that it is a bit over my head, being a newbie. I assume the command is manually innitiated within autocad, will open each file and perform an overkill task.

    Do you know a way to initiate this lisp routine after an autocad file has been opened from an external command and not within the autocad interface? (ie so that it does not require manual user input) Ideally I would want to "send" the command from a batch file, telling autocad that now that it has a drawing open to perform an overkill.


    Thanks,

    Jason

  5. #5
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: Batch/Script automation of Autocad

    Quote Originally Posted by jason.145418 View Post

    Do you know a way to initiate this lisp routine after an autocad file has been opened from an external command and not within the autocad interface? (ie so that it does not require manual user input) Ideally I would want to "send" the command from a batch file, telling autocad that now that it has a drawing open to perform an overkill.


    Thanks,

    Jason
    This lisp will do a batch by it self.
    Hi Jackson, did you have the overkill options set to your´s need ?

    Why do you want to SEND a command from a batch file , are you working from the DOS command ?

    A lisp will run from a acad dwg , this one could run from a new empty dwg.

    A way to get the lisp to be autoload is to add it to the acad200xdoc.lsp ,

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

    Default Re: Batch/Script automation of Autocad

    I would like Autocad to run without any user input from a scheduled routine. I have a *.bat file that starts autocad and open files in a folder...

    chdir c:\ptc\ilinktrail
    dir /B /S *.dwg > list_dwg.txt

    for /f "delims=" %%f in (list_dwg.txt) do (
    %startw% "C:\PTC\Ilinktrail\run_acad" "%%f"
    )

    Once autocad is open I want ot run the following *.scr file

    ZOOM
    Extents
    overkill
    all
    scr-saveas-2000
    scr-quit

    I do not want to have to manually start Autocad or have manual inputs once autocad opens a file.

    Is there a way to get the acaddoc.lsp to open a script file once a drawing file has been opened?

    Thanks

    jason

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

    Default Re: Batch/Script automation of Autocad

    You can use this LINK to make a script file and batch run everything in a directory.

    : ) Happy Computing !

    kennet

  8. #8
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: Batch/Script automation of Autocad

    Only acad200xdoc.lsp will run a lisp , yes it is possible to autorun a lisp from acad200xdoc.lsp
    In such lisp you have to state where the dwg are .

    What acad you will use to run it.??

  9. #9
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Batch/Script automation of Autocad

    Quote Originally Posted by devitg.89838 View Post
    Only acad200xdoc.lsp ...
    DON'T modify/use Acad200xDoc.lsp. That is for Autodesk's use only. AcadDoc.lsp is for user modification. If the file doesn't exist in your search path, simple create it. DO NOT modify Acad200x.lsp or Acad200xDoc.lsp.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  10. #10
    Member
    Join Date
    2007-08
    Posts
    7
    Login to Give a bone
    0

    Default Re: Batch/Script automation of Autocad

    Using the acaddoc.lsp works, I will use this file to atuload a lsp routine on drawing startup.

    Kennet: I have tried to run your lsp but it stalls on the open file name. Perhaps it has something to do with acad2007?

    Does anyone have a lisp routine that will run the "run script" command? So that when I start a document it will call up my script file.

Page 1 of 3 123 LastLast

Similar Threads

  1. script file batch for aectoacad
    By dsolak in forum AutoLISP
    Replies: 2
    Last Post: 2008-07-14, 05:13 AM
  2. Help writing a clean-up script to batch run on a set of DWG files
    By sumulong in forum AutoCAD Customization
    Replies: 3
    Last Post: 2007-01-29, 05:53 AM
  3. Batch open and save script
    By cadkiller in forum AutoCAD General
    Replies: 3
    Last Post: 2006-02-01, 02:07 AM
  4. Batch Print script
    By gen2_proton in forum AutoCAD Customization
    Replies: 2
    Last Post: 2005-04-14, 09:46 AM

Posting Permissions

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