Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using the file intro-1.dwg. I am trying to change the following settings:
Analysis Type:
- Change from "Elevations" to "Slopes".
Ranges:
- Set the "Number" to 2.
Run the analysis.
Document acDoc = AutoCadApp.DocumentManager.MdiActiveDocument;
using (acDoc.LockDocument())
using (Database acDb = acDoc.Database)
using (Transaction acT = acDb.TransactionManager.StartTransaction())
{
CivilDocument civilDocument = CivilDocument.GetCivilDocument(acDoc.Database);
BlockTable bT = acDb.GetBlockTable(acT);
BlockTableRecord modelSpace = acDb.GetModelSpace(acT);
Editor ed = acDoc.Editor;
// Select a Tin Surface
PromptEntityOptions peo = new PromptEntityOptions(
"\nSelect a tin surface: ");
peo.SetRejectMessage("\nOnly Tin surface is accepted");
peo.AddAllowedClass(typeof(TinSurface), true);
PromptEntityResult per = ed.GetEntity(peo);
if (per.Status != PromptStatus.OK) return;
CivilDocument civilDoc = CivilApplication.ActiveDocument;
TinSurface surface = acT.GetObject(per.ObjectId, OpenMode.ForRead) as TinSurface;
ObjectId styleId;
styleId = civilDoc.Styles.SurfaceStyles["Slope Banding (2D)"];
var value = surface.StyleId;
SurfaceAnalysis surfaceAnalysis = surface.Analysis;
surface.StyleId = styleId;
acT.Commit();
surface.Rebuild();
}
Solved! Go to Solution.