본문 바로가기
Programming/AutoCad .Net

[AutoCAD .Net] .dll file Load/UnLoad 방법

by 타임박스 2020. 4. 17.
반응형


✔ AutoCAD .Net dll load/unload

- NetLoad , NRL Command, compile after dll load 



● DLL Load

개발한 DLL 파일을 LOAD하는 것은 매우 간단하다.

AutoCAD 프로그램 명령어에서 NetLoad를 입력하면 파일브라우저가 실행되며 dll 파일을 선택.

 

● DLL UnLoad

dll Unload를 하려는 이유는 Visual studio에서 작업하고 바로 빌드하여 테스트하는 이유가 가장 클 것이다.

하지만 AutoCAD에서 DLL을 로드한 뒤 프로그램 수정 후 빌드하게 되면 dll을 AutoCAD에서 사용중이기 때문에 잠겨있다는 오류가 나타난다.

이를 해결하는 방법은 2가지다.

1. AutoCAD를 종료하고 작업중인 프로젝트를 빌드한 뒤 다시 AutoCAD를 켜서 확인한다.

2. Autodesk에서 제공하는 Netload.dll을 활용하여 프로젝트를 빌드한다.

누가 프로그램을 종료하고 다시 켜서 확인하겠는가?? 

2번째 방법을 적극적으로 활용해야한다. ( 조금 귀찮을 수 있다. )

NetReloader.zip
0.01MB

◆ 실행 방법

1. 위의 NetReloader.zip 첨부된 파일을 다운로드 받고 압축을 푼다.

2. Visual Studio 에서 프로젝트를 새로 만든다 ( 클래스 라이브러리 )

-> 압축 푼 파일 Commands.cs를 추가 (작업중이던 프로젝트가 있으면 해당 프로젝트에 추가)

3. 프로젝트를 빌드 한다. (Ctrl + Shift + B) 

3. AutoCAD를 실행 후 Netload를 입력 -> 압축 푼 파일 NetReload.dll을 클릭

4. AutoCAD 입력창에서 다시 Netload를 입력 -> 해당 프로젝트 파일 dll을 클릭

5. 프로젝트 내용 수정 시 Visual Studio로 빌드 하지말고 AutoCAD 명령줄에서 NRL을 입력

  (프로젝트 자동 빌드 됨)

 

자세한 사항은 아래 링크에 포함되어 있습니다.

https://forums.autodesk.com/t5/net/net-reload-utility-for-visual-studio-download-here/m-p/3185104#M25525

 

NET-RELOAD Utility for Visual Studio - Download Here

NET-RELOAD Utility   I’m sure many of you are aware that there is no "NETUNLOAD" command for unloading a .NET assembly from AutoCAD. Apparently this would require a significant change to AutoCAD's .NET API and is not likely to change anytime soon. Refer he

forums.autodesk.com

 

반응형

댓글