.NET

.NET

Reply
Active Member
THoffeller
Posts: 8
Registered: ‎10-27-2007
Message 1 of 4 (273 Views)
Accepted Solution

Accessing Project Navigator Details with .Net

273 Views, 3 Replies
09-30-2013 06:40 AM

Hello,

 

I'm trying to access the details one can define inside of the project configuration to handle their own field definitions for annotations.

I'm able to get the headers (folders) in the project configuration, but not the subdetails with their values. Is there a way to do this within the api or do I have to read the xml / apj file directly ? ;-(

 

Project _proj = null;

 

SetupProject ();

 

...

 

foreach (ProjectKey item in _proj.Configuration.StringProperties)
{

    foreach (var subitem in item. ??)

    {

        .... ???

    }
}

 

Thanks a lot,

Tim

Hello Augusto,

 

I've found a solution to access the Details in Project Setup for AutoCAD Architecture and AutoCAD MEP:

 

foreach (ProjectStringProperty item in _proj.Configuration.StringProperties)
{
foreach (StringPair strpair in item.StringPairs)
{
string res = String.Format("[PROJ_DETAIL_{0}_{1}]", item.Name.ToUpper(), strpair.Left.ToUpper());
res = res.Replace(" ", "_");
_parameterColl.Add(res, strpair.Right);
}
}

 

But in general this Project API is more or less try and error... Took me some time to figure out, that StringProperties hold the ProjectDetails Collection ;-) Maybe you can add a wish to the list to rename this Property?

And some examples for this API would be fine in ACA/samples,

 

Thanks a lot,

Tim

ADN Support Specialist
augusto.goncalves
Posts: 390
Registered: ‎04-30-2009
Message 2 of 4 (224 Views)

Re: Accessing Project Navigator Details with .Net

10-03-2013 11:53 AM in reply to: THoffeller

Hi,

 

I'm not sure which product is that... despite you posted on AutoCAD blog, seems like Plant3d... can you clarify?

 

Regards,



Augusto Goncalves
Autodesk Developer Network
Active Member
THoffeller
Posts: 8
Registered: ‎10-27-2007
Message 3 of 4 (179 Views)

Re: Accessing Project Navigator Details with .Net

10-17-2013 08:54 AM in reply to: augusto.goncalves
Hi, it is for AutoCAD Architecture and AutoCAD MEP Project Navigator.

Thanks,

Tim
Active Member
THoffeller
Posts: 8
Registered: ‎10-27-2007
Message 4 of 4 (179 Views)

Re: Accessing Project Navigator Details with .Net

10-17-2013 09:00 AM in reply to: augusto.goncalves

Hello Augusto,

 

I've found a solution to access the Details in Project Setup for AutoCAD Architecture and AutoCAD MEP:

 

foreach (ProjectStringProperty item in _proj.Configuration.StringProperties)
{
foreach (StringPair strpair in item.StringPairs)
{
string res = String.Format("[PROJ_DETAIL_{0}_{1}]", item.Name.ToUpper(), strpair.Left.ToUpper());
res = res.Replace(" ", "_");
_parameterColl.Add(res, strpair.Right);
}
}

 

But in general this Project API is more or less try and error... Took me some time to figure out, that StringProperties hold the ProjectDetails Collection ;-) Maybe you can add a wish to the list to rename this Property?

And some examples for this API would be fine in ACA/samples,

 

Thanks a lot,

Tim

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.