Running a lisp on multiple drawings

Running a lisp on multiple drawings

roland.r71
Collaborator Collaborator
11,595 Views
32 Replies
Message 1 of 33

Running a lisp on multiple drawings

roland.r71
Collaborator
Collaborator

Hi there,

 

For all those who would like to run a lisp routine, or some script code, or just a single command, on a selection of drawings: This here is my gift to you. The MultiFileTool v3.1

 

MFT-Main.png

You will need DOSlib to get it to run (which you can find here on the forum, amongst other places)

 

With this LISP routine you can do pretty much anything, to a selection of files and you can select them in as many ways as you can think of. (& you can integrate (parts of) it into your own functions.)

 

MFT-Fileselector.png

 

Explaining all it can do and how it all works would be way to much for this post.

So, i'll just add the list of options here, to get an idea of what it can do (for you)

 

Options:
 - Load a LISP file with each drawing
 - Execute user supplied commands/script/macro or even lisp code
 - Extensive options for file selection
 - Sort list of filenames
 - Save/load lists
 - Autosave & load (remember) list
 - Allow/prevent duplicate filenames
 - Supports custom made import functions to get lists from anywhere you like
 - Uses realtime checking for fileopen function
	 - Checks if the file really exists
	 - Checks if the file doesn't require a higher acad version
	 - Checks if the current file needs to, and can, be saved
	 - Ignores new-unsaved drawings (closed without saving)
	 - Open (& Close) writable files
	 - Open (& Close) Read-Only files
	 - Open (& Close) Open (other user:network) files. (read-only)
	 - Option to warn user about missing files (dialog closes after 10 sec.)
	 - Option to warn user about Read-Only & Open(network) files (incl. retry)
	 - Option to automatically skip Read-Only & Open(network) files
	 - Option to log files which where not processed.
	 - Option to ignore changes (no saving)

 

 

I just spent the last weekend writing you a manual to go with it, So, for all your questions: RTFM!

(which of course means: Please read my RichTextFormat.Manual 😛 )

Note: most of the info inside the manual can be found as comments inside the LiSP file too.

 

If you would like to help or contribute, you're Always welcome to come up with idea's or improvements, revise the code, test it on your ACAD version,  or just proof-read my manual.

Any help would be much appreciated.

It has currently been tested on 2014, 2016, 2018 & 2019 (each 64bit)

 

edit:

🤣of course RTF is the one format you can't upload... so i just converted it to docx. 

Accepted solutions (1)
11,596 Views
32 Replies
Replies (32)
Message 21 of 33

longhien2022
Explorer
Explorer

APPLOAD MultiFileTool .lsp successfully loaded.
Command: ; error: syntax error

0 Likes
Message 22 of 33

roland.r71
Collaborator
Collaborator

Hmmm... that sounds strange.
Haven't worked with ACAD much since posting the last update and currently
stuck with LT at work, so I can't immediately look into it.

Any idea where (line of code) the error occurs?

 

edit:

You are using version 3.2? (see reply# 18, or go to "solution")

& what version ACAD are you using?

 

It work[s/ed] on 2014 - 2021, never been tested with anything newer (although that should not get you a 'syntax error',  afaict.

 

0 Likes
Message 23 of 33

roland.r71
Collaborator
Collaborator

It appears there is a bug with 3.2, so I fixed that part of the code. Should be ok now.

However, I'm currently at work and here I only have LT, so I can't properly test it ...

 

Give it a try.

 

edit:

Swapped the lisp 3.2.1 for 3.2.2 solving another bug with updating the dialog list when toggling autosort, recover or duplicates.

0 Likes
Message 24 of 33

maratovich
Advisor
Advisor

Maybe this will help you - AutoRunLisp 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 25 of 33

daniel.welchLFHPQ
Contributor
Contributor

When I try to load the MultiFileTool.lsp I get a syntax error.  Then when I type "MFT" that command isn't available.  Any ideas on how to fix this?

 

danielwelchLFHPQ_0-1701391928847.png

I'm using ACAD 2023.

0 Likes
Message 26 of 33

roland.r71
Collaborator
Collaborator

At the moment, no, I have no idea.

I do have Autocad 2023 on my current system, but currently not Doslib, and company policy does not allow me to visit the github site to download it.

 

Last version I tested it on was 2021.

 

However, syntax error points to a piece of bad code, which is weird in any case.

 

Anyway, I need to get my hands on a system with Acad+Doslib first, to see whats happening.

 

0 Likes
Message 27 of 33

daniel.welchLFHPQ
Contributor
Contributor

If it helps I attached the Doslib.zip that I got from Github.  I'm using DOSLib24x64.arx for ACAD 2023 and I'm loading it through the acad.rx file.  I have the DOSLib24x64.arx file in one of the support file paths.  If I enter the command DOSLIB into the ACAD command line I get the following:

 

Command: DOSLIB
DOSLib 9.0.3
Copyright © 1992-2019 Robert McNeel & Associates.
DOSLib Loaded.

 

After messing around with it more I found that I only have the DOSLIB and DOSLIBHELP functions available.  I tried entering DOS_HELP and DOS_VERSION and I get Unknown command "DOS_HELP".  Press F1 for help.  I also noticed when I open the DOSLIBHELP that the help has no information on any of the commands it only groups and lists the commands in the section on the left.

 

This is starting to look like it might be DOSLib user error and not MFT user error.  Still any suggestions are greatly appreciated.

 

Note:  I tried re-downloading and extracting DOSLib incase something got corrupted and I still get the same issues.

0 Likes
Message 28 of 33

daniel.welchLFHPQ
Contributor
Contributor

I figured out why none of the DOSLib functions were working.  I need to have parentheses around them when I call them from the command line.  Which makes perfect sense now.  So it looks like my DOSLib is ok.

0 Likes
Message 29 of 33

ByronU78KM
Enthusiast
Enthusiast

roland.r71 - I know this is an old post. But I just found it and need it badly. I downloaded it and it works up to the int of adding drawings. I get and error code saying "Warning: 22 file(s) you're trying to add require a higher version AutoCAD to open!" Will this not work on AutoCAD Architecture 2025? Thanks Byron

0 Likes
Message 30 of 33

pkenewell6347
Advocate
Advocate

With a quick glance:

1) Looks like you need to download the latest version of doslib first: https://wiki.mcneel.com/doslib/home

2) Look for the "versionMatch" defun in the "MultiFileTool.lsp" file, Below the function look for the Acad version as shown below, and add my commented line:

; get the current (lowest) acad version for mayor release number active
      ; it is enough for the match to know the first versions for mayor release numbers
      (setq curVer
         (cdr
            (assoc progVer
              '(
                  (25 . 2025);; ADD THIS HERE!
                  (24 . 2021)
                  (23 . 2019)
                  (22 . 2018)
                  (21 . 2017)
                  (20 . 2015)
                  (19 . 2013)
                  (18 . 2010)
                  (17 . 2007)
                  (16 . 2004)
                  (15 . 2000)

               )
            )
         )
      )

Let me know if these fix your problem.

0 Likes
Message 31 of 33

daniel.welchLFHPQ
Contributor
Contributor

@roland.r71 Have you been able to get your hands on a system with ACAD and Doslib?

 

I've updated to ACADE 2024 and I also found your 3.2.2 version which got a little further.

danielwelchLFHPQ_0-1718120384958.png

 

Thank you!

0 Likes
Message 32 of 33

james.wongSCTMP
Explorer
Explorer

Hello everyone

 

I am trying to use MFT to burst all the drawings at once.

The drawings seems to show up when it loads.

but It shows an unknown command when I use BurstUpgradedV1-2

and nothing change

 

Thank you!

0 Likes
Message 33 of 33

james.wongSCTMP
Explorer
Explorer

Solved

just make the script auto run, instead of run by command....

0 Likes