Author Topic: How to save current Sample.dwg to all format/s, with VLisp?  (Read 1126 times)

0 Members and 1 Guest are viewing this topic.

d2010

  • Bull Frog
  • Posts: 323
How to save current Sample.dwg to all format/s, with VLisp?
« on: September 03, 2021, 12:57:59 AM »
Hello
When I shared online, the Sample.dwg, I need before saveAs the Drawing
to all formats (only *.dwg).
I need this VLISP, for compare the sizeof -all formats,
I select the smallest Sample.Dwg
a)First get all formats of Dwg for Save-as
b)Purge-CommandAll
c)Foreach S*ac2004,S*ac2007.S*2010 and save the Sample.dwg to
d)StartApp the application Explorer.exe
After I select (Sample2004a.dwg) from this List.
 
Code: [Select]
SAMPLE2004.dwg
SAMPLE2006.dwg
SAMPLE0014.dwg
SAMPLE2010.dwg
SAMPLE2017.dwg
:yawn:

« Last Edit: September 03, 2021, 04:44:12 AM by d2010 »

AMC

  • Mosquito
  • Posts: 3
Re: How to save current Sample.dwg to all format/s, with VLisp?
« Reply #1 on: September 03, 2021, 07:06:35 AM »
My take on it, although I'm not sure i understand what you need exactly.
Code - Auto/Visual Lisp: [Select]
  1. ;-------------------------------------------------------------------------
  2. ; Written by AMC   Sept 2021  
  3. ;-------------------------------------------------------------------------
  4. (defun c:SAMPLE_SAVE
  5.         (
  6.         /
  7.         save_format
  8.         save_format_list
  9.         )
  10.  
  11.         (setvar "filedia" 0 )
  12.        
  13.         (setq filename (strcat (getvar "dwgprefix") (substr (setq str (getvar "dwgname")) 1 (- (strlen str) 4)) ))
  14.  
  15.         (setq save_format_list '( "R14" "2000" "2004" "2007" "2010" "2013" ) )
  16.        
  17.         (foreach save_format save_format_list
  18.                
  19.                 (command "SAVEAS" save_format (strcat filename "_" save_format ))
  20.                 (command)
  21.                
  22.         ); end for
  23.        
  24.         (setvar "filedia" 1 )
  25.        
  26.         (startapp "Explorer" (strcat "/N,/E," (getvar "DWGPREFIX")))
  27.        
  28. );end defun
« Last Edit: September 03, 2021, 07:10:06 AM by AMC »