본문 바로가기

Programming/AutoCad .Net6

[AutoCAD .Net] C# 점과 선 사이의 최단 거리 구하기 ✔ C# - 점과 직선사이의 최단거리 구하기 AutoCAD에서 하나의 라인과 포인트를 선택하고 최단거리를 구하는 함수입니다. Point3d point -> AutoCAD에서 선택된 포인트를 넘겨받음 Point3d lineStartPoint -> AutoCAD에서 선택된 라인의 시작 포인트를 넘겨받음 Point3d lineEndPoint -> AutoCAD에서 선택된 라인의 끝 포인트를 넘겨받음 //직선과 점의 최단 거리를 구하는 함수 private double GetShortestDistance(Point3d point, Point3d lineStartPoint, Point3d lineEndPoint) { //X의 길이, Y의 길이를 계산 double dx = lineEndPoint.X - lineSta.. 2020. 7. 30.
[AutoCAD .Net] UnSelect Obejects In Document ✔ AutoCAD .Net - 선택된 항목 해제, 선택 항목 모두 해제 AutoCAD에서 선택된 항목들을 해제할때 사용되는 코드 아래는 선택된 항목 모두 해제하는 코드입니다. 특정 오브젝트만 해제하고 싶을 경우에는 해당 오브젝트 ID를 제외하고 넣으시면 됩니다. Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; Editor ed = acDoc.Editor; //AutoCAD 선택 모두 초기화 ed.SetImpliedSelection(new ObjectId[0]); 2020. 5. 27.
[AutoCAD .Net] Get Selected Objects In Document ✔ AutoCAD .Net C#- DWG 도면에서 선택된 오브젝트들을 불러오기 문자, 라인, 폴리라인 등 타잎별로 가져오기 AutoCAD에서 선택되어있는 항목들을 가져오는 코드입니다. 아래 코드는 선택된 오브젝트에서 문자를 확인하는 코드입니다. 라인이나 폴리라인, 원 등의 다른 Type을 얻고 싶다면 typeof(DBText)항목에서 DBText를 Line, Polyline, Circle 등으로 변경 후 활용하시면 됩니다. using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.EditorInput; private void GetSelectedItems(object s.. 2020. 5. 27.
[AutoCAD .Net] ObjectARX Download ObjectARX 버전별 다운로드 링크 버전 : 2020 (64-bit) http://download.autodesk.com/esd/objectarx/2020/objectarx_for_autocad_2020_win_64_bit.sfx.exe 버전 : 2019 (32-bit ,64-bit) http://download.autodesk.com/esd/objectarx/2019/Autodesk_ObjectARX_2019_Win_64_and_32_Bit.sfx.exe 버전 : 2018 (32-bit ,64-bit) http://download.autodesk.com/esd/objectarx/2018/Autodesk_ObjectARX_2018_Win_64_and_32_Bit.sfx.exe 버전 : 2017 (32.. 2020. 4. 21.
[AutoCAD .Net] ObjectARX 다운로드 설치 및 개발 환경 구축 ✔ AutoCAD .Net - Obejct ARX Download , .Net DLL 개발 환경 구축, ObjectARX DLL 개발 하기 전에 우선 ObjectARX 다운로드 및 설치가 필요합니다. 다운로드 및 설치는 아래 링크 참조 2020/04/21 - [Programming/AutoCad .Net] - [AutoCAD .Net] ObjectARX Download [AutoCAD .Net] ObjectARX Download ObjectARX 버전별 다운로드 링크 버전 : 2020 (64-bit) http://download.autodesk.com/esd/objectarx/2020/objectarx_for_autocad_2020_win_64_bit.sfx.exe 버전 : 2019 (32-bit ,64.. 2020. 4. 21.
[AutoCAD .Net] .dll file Load/UnLoad 방법 ✔ 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를 종료하고 작업중인 프로젝트를 빌드한 뒤 다.. 2020. 4. 17.