CAD/CAM discussion forum > CAD > File batch and scripts, create a slide file for each AutoCAD drawing in a list

File batch and scripts, create a slide file for each AutoCAD drawing in a list

    
  Subscribe Topic

Rank: 1

zenobio

Newbie

posts: 11

Registered: 2011-11-22

Message 1 of 4

 File batch and scripts, create a slide file for each AutoCAD drawing in a list
17-02-2012 05:18 . pm   |   View his/her posts only
[i=s] Post Last Edit by zenobio at 2012-2-17 17:21

Hi when i used Autocad12 in dos I found this file batch "MKSLIDE.BAT"
@Echo Off
Echo .ÿ
Echo *===[ MkSlide.Bat copyright 1992 Mountain Software ]===*
Echo .ÿ
Echo MkSlide.Bat will create a slide file for each AutoCAD drawing in a list
Echo of Directories. Use this batch file to create the initial set of AutoCAD
Echo slide files for all of your drawings.
Echo .
Echo Example:
Echo .ÿ
Echo MKSLIDE DWGS BLOCKS
Echo .ÿ
Echo will create slide files for all drawings in the directories DWGS and BLOCKS
Echo in addition to those in the current directory. MkSlide has only been tested
Echo with Release 11 and DOS 3.3/5.0 but will probably work with other versions.
Echo of DOS and AutoCAD. If AutoCAD needs any drivers or any Environment variables
Echo SET, then you must do that before running MkSlide. Make sure that all menu
Echo files, text styles, blocks, or any other external files are available,
Echo otherwise the script will fail.
Echo .ÿ
Echo Press Ctrl-C to cancel or
Echo .ÿ
Pause
Echo Creating MSlide.Scr...
:Loop
Set _DIR=%1
If [%_DIR%]==[] SET _DIR=.
If Exist MkSlide.Scr Del MkSlide.Scr
For %%f In (%_DIR%\*.dwg) Do Echo 2 %%f .ZOOM E .ZOOM 0.9X .MSLIDE .QUIT Y>>MkSlide.Scr
Echo 0>>MkSlide.Scr
If Not Exist %_DIR%\*.dwg GoTo NoDwgs
Echo Loading AutoCAD...
ACAD Dummy MkSlide
:NoDwgs
If [%_Dir%]==[.] Goto Done
Shift
GoTo Loop
:Done
Echo Done
Set _DIR=


the file make a file script (*.scr) like this:

2 .\01NORTH.dwg .ZOOM E .ZOOM 0.9X .MSLIDE .QUIT Y
2 .\02NORTH.dwg .ZOOM E .ZOOM 0.9X .MSLIDE .QUIT Y
2 .\03NORTH.dwg .ZOOM E .ZOOM 0.9X .MSLIDE .QUIT Y
...............


now I changed this line

For %%f In (%_DIR%\*.dwg) Do Echo 2 %%f .ZOOM E .ZOOM 0.9X .MSLIDE .QUIT Y>>MkSlide.Scr

in this

For %%f In (%_DIR%\*.dwg) Do Echo OPEN "%_DIR%/%%f" _ZOOM E _ZOOM 0.9X _MSLIDE _QUIT Y>>MkSlide.Scr

that give me this script

OPEN "./.\01NORTH.dwg" _ZOOM E _ZOOM 0.9X _MSLIDE _QUIT Y
OPEN "./.\02NORTH.dwg" _ZOOM E _ZOOM 0.9X _MSLIDE _QUIT Y
OPEN "./.\03NORTH.dwg" _ZOOM E _ZOOM 0.9X _MSLIDE _QUIT Y
...............


with e text editor I adapt the line in this

OPEN "C:/my_folder/01NORTH.dwg" _ZOOM E _ZOOM 0.9X _MSLIDE _QUIT Y
OPEN "C:/my_folder/02NORTH.dwg" _ZOOM E _ZOOM 0.9X _MSLIDE _QUIT Y
OPEN "C:/my_folder/03NORTH.dwg" _ZOOM E _ZOOM 0.9X _MSLIDE _QUIT Y
...............


Zwcad open the files but does nothing elsethat is wrote in comand line:

Comando: OPEN
Nome del Disegno : "C:/my_folder/01NORTH.dwg" _ZOOM E _ZOOM 0.9X _MSLIDE _QUIT Y
...............

and so on

I tried also without quote in the name of dwg (C:/my_folder/01NORTH.dwg) and with c: before comands (C:_zomm)
but the result is the same.

where I'm wrong ?

thanks for the answers this file batch was very helpful for create slide for my library

Rank: 1

DDWZW

Newbie

posts: 142

Registered: 2011-11-23

Message 2 of 4

20-02-2012 10:06 . am   |   View his/her posts only
it's a little bit complicated...

Rank: 1

zenobio

Newbie

posts: 11

Registered: 2011-11-22

Message 3 of 4

24-02-2012 10:13 . pm   |   View his/her posts only
Post Last Edit by zenobio at 2012-2-24 22:15

I already use scripts for setting some variables in my draws, this for exaple :
_osmode 235
_SCROLLBAR ON
_UCSICON _c
-style arial arial
_-LAYER N QUOTE;;
_-LAYER N MURI C 3 MURI;;
_-insert d:/l/lib2/freccia/frecci5;0,0;;;;
_ERASE L;;
-DIMSTYLE SA Zenobio
PDMODE 3
DIMADEC 0
…..........
DIMZIN 0
with which I imposed the dimension variables, object snaps, layers etc.
and it works well
but with this script I do not understand where is the problem

If it were easy I would not ask for help

Rank: 1

DDWZW

Newbie

posts: 142

Registered: 2011-11-23

Message 4 of 4

05-03-2012 02:48 . pm   |   View his/her posts only
I'm not a programing guy.
who can help?
See also
X