home *** CD-ROM | disk | FTP | other *** search
- @echo off
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: ADSDB.BAT: Script for Debugging AutoCAD ADS applications. ::
- :: version 1.02 ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: IMPORTANT: This file is for debugging AutoCAD ADS applications. If ::
- :: you are using AutoCAD Release 11 or earlier, you must ::
- :: set HCDIR in your environment. ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
- if not "%1x" == "x" goto exists
- echo syntax is: adsdb program
- goto over
-
- :exists
- if exist %1.exp goto ok
- echo NO APPLICATION "%1.exp" FOUND IN THE CURRENT DIRECTORY
- goto over
-
- :ok
- set EXPDEBUG=ADS
-
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Set next line to 12 if using AutoCAD Release 12 or later; otherwise, ::
- :: set it to 11. ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: set ADS_VERSION=11
-
- if not "%ADS_VERSION%x" == "x" goto cont1
- echo PLEASE SET THE VALUE OF ENVIRONMENT VARIABLE ADS_VERSION IN THIS BATCH FILE
- goto over
-
- :cont1
-
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Set next line to the full pathname of ACAD.EXE; for example: ::
- :: set ACADPATH=c:\ACAD11 ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: set ACADPATH=c:\ACAD11
-
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Save old ACAD environment variable
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- set oldacad=%ACAD%
- set ACAD=%oldacad%;%ACADPATH%
-
- if not "%ACADPATH%x" == "x" goto journal
- echo PLEASE SET THE VALUE OF ENVIRONMENT VARIABLE ACADPATH IN THIS BATCH FILE
- goto over
-
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Create Journal file to set up proper debugger environment. ::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :journal
- countapp %1 %ADS_VERSION% > %1.jou
- if errorlevel 1 goto over
-
- if "%ADS_VERSION%x" == "12x" goto ver12
- if "%ADS_VERSION%x" == "11x" goto ver11
- echo PLEASE SET THE VALUE OF ENVIRONMENT VARIABLE ADS_VERSION IN THIS BATCH FILE
- goto over
-
- :ver11
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Execute AutoLISP code to get to _mwINIT before the control is passed to::
- :: the application you are debugging ::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- echo @^step\ in\ +013 >> %1.jou
- echo @^step\ in\ +013 >> %1.jou
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
- echo @^go\ main\ +013 >> %1.jou
- set R386=-priv
- echo mdb @@%1.jou %ACADPATH%\acad.exe
- mdb @@%1.jou %ACADPATH%\acad
- set R386=
- goto over
-
- :ver12
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Execute AutoLISP code to get to _mwINIT before the control is passed to::
- :: the application you are debugging ::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- echo @^go\ til\ call+013 >> %1.jou
- echo @^go\ til\ call+013 >> %1.jou
- echo @^step\ in+013 >> %1.jou
- echo @^step\ in+013 >> %1.jou
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
- echo @^go\ main+013 >> %1.jou
- set R386=-callbufs 2 -nistack 10
- echo mdb @@%1.jou %ACADPATH%\acad.exe
- mdb @@%1.jou %ACADPATH%\acad
- set R386=
-
- :over
- if exist %1.jou del %1.jou
- set ACADPATH=
- set ADS_VERSION=
- set EXPDEBUG=
- set ACAD=%oldacad%
- set oldacad=
-