Click here to Skip to main content
15,897,090 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How can I get Current Active Autocad Sheet Set File's Path,Name and other Informations using C# or Autocad API?
Posted
Updated 12-Jan-16 0:29am
v2
Comments
Tomas Takac 12-Jan-16 6:30am    
I suggest you consult the documentation.
ZurdoDev 12-Jan-16 7:37am    
I second what Tomas said.

1 solution

Hi, refer the following code,
C#
AcadApplication Acad = (AcadApplication)Marshal.GetActiveObject("AutoCAD.Application");
string ActiveDocumentName = Acad.ActiveDocument.Name; // gets name of active document
string ActiveDocumentPath = Acad.ActiveDocument.FullName; // gets name with path of active document
and refer the following article,
Quick Start: AutoCAD 2D Drawing using C# with AutoCAD COM API[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900