See the top rated post in this thread. Click here

Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Open all drawings in a directory, save, close.

  1. #11
    Member
    Join Date
    2019-11
    Posts
    3
    Login to Give a bone
    0

    Default Re: Open all drawings in a directory, save, close.

    Dear terry,

    can u send again all related files of lisp if i missed in my side snap1.PNG

    actually my propose of use is in one folder having 100 cad drawings i need to use in single command to give the path to make open,zoom extend, purge all, save and close the drawing in one command, because we are extracting 500 cad drawings from tekla software for daily to shipment for fabrication

    can u help me .....

    sankar

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

    Default Re: Open all drawings in a directory, save, close.

    Simple macro example for doing this just for the current drawing:
    Code:
    $M=$(if,$(eq,$(getvar,dwgtitled),0),saveas,$(if,$(eq,$(getvar,tilemode),0),$(if,$(eq,$(getvar,cvport),1),Z;E;,PS;Z;E;))tilemode;1;Z;E;_qsave;CLOSE)
    Just to point out a few things to consider.
    Has the drawing been titled (saved before)? Wouldn't be an issue in this case.
    Model space tab or/and layout?
    What to do if in a viewport? As long as it's locked no problem.

    Consider running it on a test folder first to make sure you get the results you're looking for, there's no undo for something like this.

  3. #13
    Login to Give a bone
    2

    Default Re: Open all drawings in a directory, save, close.

    Hi Sankar,
    The following link is the newest version of Scrs.lsp.
    There have been a few minor changes, but it basically runs the same as it has.
    It will not run on AutoCAD lite.
    I highly recommend putting loading the program in your AcadDoc.lsp.
    This works for our company anyway. That way AcadDoc.lsp loads the same programs on every computer.
    If you are not sure where it's located try this on the command line:
    Command: (findfile "acaddoc.lsp")
    Mine returns: "C:\\Custom"AutoLISP\\Acaddoc.lsp"
    It is usually located in the folder where you save all your AutoLISP programs, and is in your "Support File Search Path" under the File tab in the Options dialog.
    Open it with NotePad.exe and include the line:
    (load "scrs.lsp")

    My website http://web2.airmail.net/terrycad that hosted AutoLISP Exchange, Scrs.lsp and Getting Started with DCL Dialogs has been moved to the new domain https://autolisp-exchange.com . All programs and files are free to download and share. Just click on a button to view the program, then right-click and choose Save as...

    Here is the direct link to Scrs.lsp and Scrs.dcl:
    https://autolisp-exchange.com/LISP/Scrs.lsp
    https://autolisp-exchange.com/LISP/Scrs.dcl

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

    Default Re: Open all drawings in a directory, save, close.

    Quote Originally Posted by Terry Cadd View Post
    My website http://web2.airmail.net/terrycad that hosted AutoLISP Exchange, Scrs.lsp and Getting Started with DCL Dialogs has been moved to the new domain https://autolisp-exchange.com . All programs and files are free to download and share. Just click on a button to view the program, then right-click and choose Save as...
    Long time fan, thanks for the updated links. Your DCL tutorials are both thorough and easy to follow. Troy.lsp brought back memories of spending a lot quarters years ago.

  5. #15
    Login to Give a bone
    1

    Default Re: Open all drawings in a directory, save, close.

    Sankar,
    Were you able to even load the dialog for Scrs.lsp? I was hoping to find out, and try to figure out why you get the error of ";error: quit / exit abort". Also what commands were you typing in the dialog for your script? if you see the following alert you can still test a script on the current drawing, but it should still work.
    Script_Alert.png
    Terry
    Last edited by Terry Cadd; 2020-04-15 at 02:55 PM.

  6. #16
    Member
    Join Date
    2019-11
    Posts
    3
    Login to Give a bone
    0

    Default Re: Open all drawings in a directory, save, close.

    Dear terry,

    Its not working i am facing same problem what u given....

    sankar

  7. #17
    Login to Give a bone
    0

    Default Re: Open all drawings in a directory, save, close.

    I see you are using APPLOAD to load Scrs.lsp. Did you save Scrs.lsp and Scrs.dcl to the same folder in your AutoCAD Support File Search Path? This information is on the first Files tab on the Options dialog menu. It seems that it is not finding the dialog Scrs.dcl file which may be the reason it stops. If you are getting the dialog to appear, try a few simply commands like ZOOM E and see if even that is working.

    I guess my main question is: Do you even get the dialog to appear?
    If it does use the short-cut Alt+PrtScreen to capture the dialog as an image and open MS-Paint.exe and paste in your image and save it.
    In this forum reply and press the [Go Advanced] button to reply and one of the square options images looks like a tree in a picture frame (Insert Image).
    Click on it and locate the saved dialog image on your computer and upload it.
    That way we can see what you are seeing on your end.
    Thanks for trying this.
    Terry

    Scrs.jpg
    Last edited by Terry Cadd; 2020-05-08 at 03:15 PM. Reason: To show different ways of entering script information.

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

    Default Re: Open all drawings in a directory, save, close.

    Batch processing Scripts in AutoCAD is done in series (one-at-a-time); if you'd prefer to run them in parallel, consider using Core Console:

    https://forums.augi.com/showthread.p...=1#post1339054
    "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

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

    Default Re: Open all drawings in a directory, save, close.

    mistake , sorry

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 3
    Last Post: 2013-03-27, 05:41 PM
  2. Replies: 11
    Last Post: 2011-01-27, 04:33 PM
  3. How to quickly save and close multiple open projects and families!
    By craighowie in forum Revit Architecture - General
    Replies: 4
    Last Post: 2010-11-17, 03:24 PM
  4. VBA routine to save and close some open drawings
    By GreyHippo in forum VBA/COM Interop
    Replies: 1
    Last Post: 2010-03-24, 11:59 AM
  5. Replies: 3
    Last Post: 2006-07-19, 06:11 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
  •