FAQ: 도면 파일 프로젝트 또는 폴더를 현재 버전으로 다시 저장하려면 어떻게 합니까?

배치 파일을 사용하여 이전 버전의 도면 파일 프로젝트 또는 디렉토리를 현재 버전으로 다시 저장합니다.

배치 파일을 사용하여 이전 버전의 AutoCAD Architecture 2024 툴셋에 저장된 도면 파일을 현재 버전으로 다시 저장하는 작업을 자동화할 수 있습니다.

배치 파일을 실행하면 이전 버전 도면이 있는 프로젝트 또는 폴더의 전체 복사본이 만들어집니다. 그런 다음 이 위치에 있는 모든 DWG, DWT 및 DWS 파일을 반복해서 검색하고 스크립트 파일을 생성합니다.

스크립트 파일을 실행하면 복사된 각 DWG 및 DWT 파일이 열리고 저장된 후 닫힙니다. 이 경우 모든 DWG 및 DWT 파일이 현재 버전으로 다시 저장됩니다.

스크립트는 DWS 파일에 대한 경로를 표시합니다. DWS 파일을 수동으로 연 후 현재 버전으로 저장해야 합니다.

중요사항: 배치 및 스크립트 파일을 실행하기 전에 모든 파일 백업을 만들어야 합니다. 프로젝트를 새 위치로 복사한 경우 배치 파일을 실행하기 전에 원래 버전의 AutoCAD Architecture 2024 툴셋을 사용하여 프로젝트 경로를 다시 지정합니다.

배치 파일을 사용하여 현재 버전으로 파일 가져오기

    중요사항: 다음 단계를 정확히 따릅니다.
  1. Microsoft® 메모장을 시작합니다.
  2. 두 개의 대시 선 사이에 있는 문자(배치 파일)를 복사한 후 메모장에 붙여 넣습니다.
  3. promote.bat 이름으로 파일을 저장하고 메모장을 닫습니다.
  4. Windows® 명령 프롬프트에서 다음 구문을 사용하여 promote.bat 파일을 실행합니다.
    promote.bat [projectName] [projectLocation] [scriptName] [promotionTarget] 
    Replace [projectName] with the name of the original folder containing the drawings to be imported to the current version. 
    Replace [projectLocation] with the path to the original folder entered as [projectName]. 
    Replace [scriptName] with the name of the script that will be generated. The root of the file name can be customized but the file extension must always be .scr. 
    Replace [promotionTarget] with a path and folder name of the location where the imported drawings must be copied.
    주: 공백을 포함하는 인수는 따옴표로 묶어야 합니다. 예를 들어, 이전 버전으로 저장한 도면을 R:\CAD_Files\Projects\2010\Hospital에 저장하고 다시 저장된 파일을 R:\CAD_Files\Projects\2014\Hospital 폴더에 작성하려면 다음 구문을 사용합니다.
    promote.bat Hospital R:\CAD_Files\Projects\2010\ promote.scr R:\CAD_Files\Projects\2014
  5. 완료되면 사용자가 지정한 이름의 스크립트 파일이 promote.bat 파일이 있는 동일한 폴더에서 생성됩니다. [promotionTarget] 위치에 있는 각 복사된 도면을 현재 버전으로 자동으로 다시 저장하려면 이 스크립트 파일을 실행합니다.

배치 파일

--------------------------------------------------------------------------------------------
@echo off
SETLOCAL
@rem promote.bat
@rem This script promotes a project to the current DWG format.
:Greeting
echo.
echo This script promotes a project to the current DWG format.
echo For best results, please run this script using administrator privileges in Windows.
echo.
PAUSE
:checkCmdArgs
if [%4] EQU [] goto :badArgCount
if [%3] EQU [] goto :badArgCount
if [%2] EQU [] goto :badArgCount
if [%1] EQU [] goto :badArgCount
if [%5] NEQ [] goto :badArgCount
set prjName=%1
set prjDir=%2
set scrName=%3
set targetDir=%4
goto :checkProject
:getProject
set /P prjName="What is the name of the project?: "
set /P prjDir="Where can it be found?: "
goto :checkProject
:checkProject
set prjNameEsc=%prjName:&=^&%
set firstChar=%prjName:~0,1%
if ^%firstChar% EQU ^" set prjName=%prjNameEsc:~1,-1%
set prjNameDisplay=%prjName:&=^^^&%
set prjDirEsc=%prjDir:&=^&%
set firstChar=%prjDir:~0,1%
if ^%firstChar% EQU ^" set prjDir=%prjDirEsc:~1,-1%
set prjDirDisplay=%prjDir:&=^^^&%
set project="%prjDir%\%prjName%"
if not exist %project% goto :noProject
if not defined scrName (goto :getScript) else (goto :checkScript)
:getScript
set /P scrName="Specify a name for the ACAD script: "
goto :checkScript
:checkScript
set scrNameEsc=%scrName:&=^&%
set firstChar=%scrName:~0,1%
if ^%firstChar% EQU ^" set scrName=%scrNameEsc:~1,-1%
set scrExt=%scrName:~-4%
if /I "%scrExt%" NEQ ".scr" set scrName=%scrName%.scr
set scrNameDisplay=%scrName:&=^^^&%
if exist "%scrName%" goto :scrFound
if not defined targetDir (goto :getTarget) else (goto :checkTarget)
:getTarget
set /P targetDir="Specify a directory to host the promoted project: "
goto :checkTarget
:checkTarget
set targetDirEsc=%targetDir:&=^&%
set firstChar=%targetDir:~0,1%
if ^%firstChar% EQU ^" set targetDir=%targetDirEsc:~1,-1%
set targetDirDisplay=%targetDir:&=^^^&%
set prjDest="%targetDir%\%prjName%"
if not exist "%targetDir%" (
md "%targetDir%"
echo.
echo Created target directory %targetDirDisplay%
goto :copyProject
) else (
if exist %prjDest% (goto :targetFound) else (goto :copyProject)
)
ENDLOCAL
exit /B
:badArgCount
echo.
echo This utility can be run as a single command with the following syntax:
echo.
echo promote.bat [projectName] [projectLocation] [scriptName] [promotionTarget].
echo.
goto :getProject
:noProject
echo.
echo You have specified a project %prjNameDisplay% in the directory %prjDirDisplay%.
echo This could not be found. Please try again.
echo.
goto :getProject
:badScrExt
echo.
echo Your Autocad script must have the extension ".scr" and you specified %scrNameDisplay%.
echo Please try again.
echo.
goto :getScript
:scrFound
echo.
echo An Autocad script with the name %scrNameDisplay% is already present in the working directory.
echo Delete this script or specify a different script name.
echo.
goto :getScript
:targetFound
echo.
echo A project with name %prjNameDisplay% was found in the target area %targetDirDisplay%.
echo Delete this project or specify another target area.
echo.
goto :getTarget
:copyProject
echo.
CLS
echo Copying project %prjNameDisplay%...
xcopy %project% %prjDest% /E /I /Q /H
attrib -A -R %prjDest% /D /S
echo Copied project %prjNameDisplay% to %prjDest%.
echo.
goto :genScript
:genScript
echo.
set count=0
@for /R %prjDest% %%i in (*.dwg) do (
set /a count+=1
echo _open "%%i">>"%scrName%"
echo _qsave>>"%scrName%"
echo _close>>"%scrName%"
)
echo Found %count% DWG files to be updated in the project %prjNameDisplay%.
set /a totalFiles=%count%
set count=0
@for /R %prjDest% %%i in (*.dwt) do (
set /a count+=1
echo _open "%%i">>"%scrName%"
echo _qsave>>"%scrName%"
echo _close>>"%scrName%"
)
echo Found %count% DWT files to be updated in the project %prjNameDisplay%.
echo.
set /a totalFiles=%totalFiles%+%count%
if %totalFiles% == 0 (
echo.
echo No DWG or DWT files were found in the project %prjName%!
echo There is nothing to promote.
echo.
echo Deleting the copy of %prjName% from %targetDir%.
echo The directory %targetDir% has been retained in case other folders or files are present.
echo.
RMDIR /Q/S %prjDest%
) else (
echo.
echo TO COMPLETE THE PROMOTION:
echo.
echo [1] Start ADT and make sure that a project is NOT currently active.
echo [2] Disable the previous version courtesy dialog using the AecFileOpenMessage command.
echo [3] Verify that the copy of the project located at %targetDirDisplay% has the same
echo file count as the original copy located at %prjDirDisplay%.
echo [4] Run the script %scrNameDisplay%.
@for /R %prjDest% %%i in (*.dws) do (
set /a foundDWS=1
goto :break
)
:break
if DEFINED foundDWS (
echo [5] Resave the following DWS file^(s^), making sure to preserve filenames.
echo ^(These cannot be promoted via a script as DWT and DWG files can.^)
echo.
@for /R %prjDest% %%i in (*.dws) do (
echo %%i
)
)
echo.
echo.
echo The project %prjNameDisplay% located in %targetDirDisplay% will then be promoted
echo to the current file format.
echo.
echo After this process is complete you may use this project
echo where it currently resides, or replace the old one with this new copy.
echo.
)
ENDLOCAL
exit /B
------------------------------------------------------------------------------------------------------

문제 해결

이 스크립트를 사용하는 동안 이전 버전의 도면이 열릴 경우 대화상자가 표시되면 스크립트가 종료됩니다. 계속해서 다시 나머지 도면을 현재 버전으로 다시 저장하려면:
  1. 스크립트 파일을 편집하고 성공적으로 다시 저장된 이전 버전의 마지막 도면까지 해당 참조를 모두 제거합니다.
  2. 예기치 않은 대화상자가 표시된 원인을 파악하고 필요한 단계를 수행하여 해당 대화상자를 제거합니다.
  3. 수정된 스크립트 파일을 실행합니다. 복사된 도면의 나머지 부분을 현재 버전으로 다시 저장해야 합니다.
그런 다음, 예기치 않은 대화상자가 표시되어 스크립트가 자주 중지되면 AutoCAD Architecture 2024 툴셋 명령행에 AecFileOpenMessage를 입력하고 값을 No로 변경합니다.
중요사항: 다시 저장 프로세스가 완료되면 AecFileOpenMessage 값을 다시 Yes로 복원합니다.