ACA API: Accessing Project Properties

Q.  Using AutoCAD Architecture, we want to take information about the Project properties (Name, Number, Description). All the examples I can find online are to create a new project file using the API. I want to read the Project properties for the currently open Project in Architecture through the API. Is there a simple way to do this? 

A.  You can use Autodesk.Aec.ProjectConfiguration class.  It allows you to access information about the project, such as the name, description, and number. Below is a simple code snippet I added to the API sample AecProjectBaseSampleMgd:

private void Config()         {                           ProjectConfiguration projConfig = proj.Configuration; // new ProjectConfiguration();               string s = projConfig.Name + ", ";             s += projConfig.Number + ", ";             s += projConfig.Description;             Print(s);         }

For your convenience, I have attached a modified version of the sample: Download AecProjectBaseSampleMgd

To use this class, you will need to reference AecProjectBaseMgd.dll
Attached was built with ACA 2016, using .NET 4.5 

Mikako


Comments

2 responses to “ACA API: Accessing Project Properties”

  1. I’d like to thank the author for writing such an insightful and informative blog post about aca api that is not just useful to the readers but also revealing.

  2. It is possible to get information about root path of project from drawing attached to this project when this project is not currently opened?

Leave a Reply to Technostruct LLCCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading