I have two lisp files.
1) layfrzdwgdir
- This Lisp freezes specified layers throughout an entire set of drawings.
Can someone please take a look at the layfrzdwgdir lisp file and create a separate lisp file that can UNfreeze specified layers throughout an entire set of drawings?
2) zoome
- This Lisp performs zoom extent within multiple viewports on a single drawing.
Can someone please take a look at the zoome lisp and create a separate lisp that can perform the function throughout an entire set of drawings?
I hope you someone is able to help me reach a resolution.
Thank you!
(defun zoomedwgdir ()
(foreach dwgname (dir "*.dwg") ; Loop through drawing files
(command "open" dwgname) ; Open the current drawing
(c:zeavp) ; Call the existing zoom extents function
(command "save" "yes") ; Save the drawing
(command "quit")) ; Close the drawing
(princ "\nZoom extents completed for all drawings."))
(defun c:zeavp ( / c) ; Existing function from zoome.lsp (unchanged)
(setq c (getvar "CTAB"))
(foreach l (layoutlist)
(setvar "CTAB" l)
(c:zoome))
(setvar "CTAB" c)
(princ))
(princ "\nType zoomedwgdir or (zoomedwgdir) to run")
for your layfrzdwgdir.lsp to change to unfreeze then change this line:
:vlax-true ;; the value you want each listed layer to be set to
to this line:
:vlax-false ;; the value you want each listed layer to be set to
This solution did not work. Please view the attached code per your recommendations and let me know if we can come up with a different solution. Thank you!
There was actually another location where :vlax-true had to be replaced with :vlax-false
Also you don't need to replace 'freeze with 'unfreeze
Use the attached revised code.
Paul, that worked! Thank you so much sir! Now, do you think we can customize the zoome lisp so that it applies to the entire set of drawings in a directory? (similar to the layunfrzdwgdir lisp) Please let me know. Thanks!
Below is the error I received when entering "zoomedwgdir: or "(zoomedwgdir)" in the command line:
; error: no function definition: DIR
@paullimapa I'm pretty new to Lisp and I thought that would work. Sorry, I couldn't be more help 😞
Here's one method to run Zoome.lsp on a set of dwgs in a folder:
Script Writer | Lee Mac Programming (lee-mac.com)
Download & install and then fill out the Script Line on Lee Mac's program like this (assume your Zoome.lsp is in a AutoCAD's File Support Search Path location):
_.Open *file* (load"zoome") ZoomE _.Qsave _.Close
Here's another method to apply zoome.lsp to all dwgs in a selected folder.
Save attached DwgAccPikScr.lsp , Zoome.lsp & unzip Zoome.scr in a folder under one of AutoCAD> Options> Support File Search Path & Trusted Locations
Then at AutoCAD command prompt load DwgAccPikScr.lsp by typing following:
(load"DwgAccPikScr")
Then run by entering at command prompt:
DwgAccPikScr
Select the folder where the dwgs are and then select Zoome.scr
I’m surprised script files in a batch file is not allowed at your office. This is a major advantage that allows for automation without a need to open drawings in AutoCAD. Since DWGACCPIKSCR lisp is purposely designed to take advantage of batch processing dwgs without opening them, then this method cannot be used in your office.
Here's a modified version I call DwgAccPikScrA.lsp
This version does NOT create a batch file to apply the selected script file to all the dwgs in the selected folder.
But instead it runs the entire process within AutoCAD.
Let me know if this version bypasses the batch Script restrictions in your office.
Can't find what you're looking for? Ask the community or share your knowledge.