How to update/change Civil 3D Corridor subassembly Parameter values?

By Partha Sarkar

If you want
to change / update a subassembly parameter e.g. "Slope", you can
currently use Civil 3D COM API as .NET API in the current release (Civil 3D
2013) doesn't support this. 

Here is a C#
.NET code snippet demonstrating usage of AeccSubassembly COM API and how to
change "Slope" parameter value.

AeccRoadwayApplication roadwayApp = new AeccRoadwayApplication();
roadwayApp.Init((AcadApplication)Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication);
AeccRoadwayDocument roadwayDoc = roadwayApp.ActiveDocument as AeccRoadwayDocument;
AeccRoadwayDatabase roadwayDb = roadwayDoc.Database as AeccRoadwayDatabase;
AeccSubassembly subassembly = roadwayDb.Subassemblies.Item(0);
IAeccParamsDouble paramsDouble = subassembly.ParamsDouble;
IAeccParamDouble slopeParam = paramsDouble.Item("Slope");
ed.WriteMessage("n Subassembly Slope parameter Before Change : " + slopeParam.Value.ToString());
// Change the slopeParam Value  
slopeParam.Value = -0.01;
ed.WriteMessage("n Subassembly Slope parameter After Change : " + slopeParam.Value.ToString());

 
Hope this is useful to you!


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

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

Continue reading