.NET

Reply
Active Member
THoffeller
Posts: 8
Registered: ‎10-27-2007
Message 1 of 2 (129 Views)

Adding a Construct via AddConstruct to my ACA project

129 Views, 1 Replies
04-03-2013 04:11 AM

Hello,

I try to use the ACA .Net c# API to add a new construct to my project. Currently in 2013.

In the samples I've found one for basic Projetnavigator things, but adding a new construct isn't covered.

Is there any example out there which shows the steps?

 

THanks,

Tim

 

Active Member
THoffeller
Posts: 8
Registered: ‎10-27-2007
Message 2 of 2 (105 Views)

Re: Adding a Construct via AddConstruct to my ACA project

04-03-2013 06:48 AM in reply to: THoffeller

ok, found the solution. Here's some code from my method:

 

ProjectFile info = newProjectFile(_proj);

info.DrawingFullPath =

Path.Combine(Path.GetDirectoryName(item.FullName), filename + ".dwg");

info.FileName =

Path.Combine(Path.GetDirectoryName(item.FullName), filename + ".xml");

info.FileCategory =

FileCategory.Document;

info.Name = filename;

info.Description = filename +

" autogenerated by CadDev ProjectStartup";

 

//info.Category = new DirectoryInfo(Path.GetDirectoryName(item.FullName)).Name;ProjectRegion reg = newProjectRegion();

reg.Add(

newRegionPair(System.Convert.ToUInt32(level.Id), System.Convert.ToUInt32(wing.Id)));

info.Regions.Add(reg);

//info.Id = level.Id;if (String.IsNullOrEmpty(dirconf.DrawingTemplate))

_proj.AddConstruct(info, _proj.Configuration.DocumentTemplate);

else

{

_proj.AddConstruct(info, dirconf.DrawingTemplate);

}

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.