AutoCad LISP - Open DWG resave as DWT in same location and Close

AutoCad LISP - Open DWG resave as DWT in same location and Close

tomhY595S
Enthusiast Enthusiast
522 Views
4 Replies
Message 1 of 5

AutoCad LISP - Open DWG resave as DWT in same location and Close

tomhY595S
Enthusiast
Enthusiast

Hi I'm in the process of updating the office CAD library, We have a bunch of blocks in the hundreds that are dwg files some dwt, we use shared access servers for where these are saved, however apart from the block edit lock. I want to have the library blocks as Template files. Is anyone aware of an existing LISP or how to create a new one that would essentially

  1. Open all files within a given folder
  2. If we can also include - Change allow block edit to 'No' that would also be great.  
  3. Zoom Extents
  4. save as dwt using the file name for description (saved in same folder location) or if easier new location path 
  5. then close

 Thanks 

Tom

0 Likes
523 Views
4 Replies
Replies (4)
Message 2 of 5

pendean
Community Legend
Community Legend
@tomhY595S side note... you do know that a DWT is just a DWG file with a renamed File Extension that you yourself an do in Windows File Explorer without ever opening AutoCAD, right? All you have to do is ensure you have file extensions turned on https://fileinfo.com/help/windows_10_show_file_extensions

Message 3 of 5

tomhY595S
Enthusiast
Enthusiast

Thanks, Pendean. Yes, I completely forgot about that 🙂 

0 Likes
Message 4 of 5

Sea-Haven
Mentor
Mentor

I would go the other way dwt -> dwg. You can see the block catergorys and yes 100's on a server. The blocks all have image select.

 

SeaHaven_0-1656389786802.png

 

 

 

0 Likes
Message 5 of 5

pendean
Community Legend
Community Legend

@tomhY595S wrote:

Thanks, Pendean. Yes, I completely forgot about that 🙂 


FYI if these external drawings are just single blocks each, you cannot "set to not edit" since inside the DWG file they are just the elements of the block (otherwise AutocAd gets stuck in an endless loop and makes your file useless).

 

Script writing tutorial is here since all you want to do (after the above is no longer an option) is open a bunch of files then Zoom Extents (you might as well PURGE twice and AUDIT while you are at it) http://www.lee-mac.com/scriptwriting.html

 

Windows freeware to rename file extensions https://www.google.com/search?q=windows+freeware%3A+rename+file+extensions

 

HTH

0 Likes