How to Retrieve the Current Project Object in AutoCAD Architecture ?

How to Retrieve the Current Project Object in AutoCAD Architecture ?

ramesh_choudhari
Enthusiast Enthusiast
1,203 Views
4 Replies
Message 1 of 5

How to Retrieve the Current Project Object in AutoCAD Architecture ?

ramesh_choudhari
Enthusiast
Enthusiast

Hi everyone,

I'm currently working on a project where I need to access the current project object in AutoCAD Architecture programmatically using the "AecProjectBaseMgd" dll. I've been able to successfully retrieve the current project object by specifying the project path explicitly. However, I'm facing a challenge in obtaining the current project object without specifying the project path.

 

Is there a way to retrieve the current project object without needing to provide the project path explicitly?

 

Any guidance or example code snippets would be greatly appreciated. Thank you in advance for your help!

 

current code :

ramesh_choudhari_1-1712819439295.png

 

0 Likes
Accepted solutions (2)
1,204 Views
4 Replies
Replies (4)
Message 2 of 5

Gepaha
Collaborator
Collaborator
Accepted solution
Project currentProject = projectManager.OpenProject(OpenMode.ForRead, projectManager.CurrentProjectFileName.Path);
Message 3 of 5

ramesh_choudhari
Enthusiast
Enthusiast

How can I access the object of a project that is already opened in AutoCAD Architecture, without the need to reopen it using `projectManager.OpenProject()`?

0 Likes
Message 4 of 5

Gepaha
Collaborator
Collaborator

If there is something like that, I don't know. To read data I use "ProjectOpen" with "OpenMode.ForRead" and to modify I use "OpenMode.ForWrite".
Data access not only occurs in the current project but also in other projects that are not the current one.
To access the current project just use "OpenProject" with "projectManager.CurrentProjectFileName.Path".

Basically it is manipulating files and folders in Windows Explorer.

0 Likes
Message 5 of 5

ramesh_choudhari
Enthusiast
Enthusiast
Accepted solution

ok thank you..!

0 Likes