Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I have a question Help me~ about data Cut and Fill

2 REPLIES 2
Reply
Message 1 of 3
flycoflyco
853 Views, 2 Replies

I have a question Help me~ about data Cut and Fill

I want to draw a TotalVolumeTable in Excel. But , I don't know how to access to TotalVolumeTable data..

 

What methods do you use to access data.

 

What should I do? 

 

SampleLine? or Section? or QTOMaterialList?

 

😞

 

Posting with my source code.

 

[CommandMethod("test")]

public void test11()
{

            CivilDocument cdoc = CivilApplication.ActiveDocument;
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; Database db = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database; Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; PromptEntityOptions peo = new PromptEntityOptions("Alignment"); peo.SetRejectMessage("\n선형이 아닙니다."); peo.AddAllowedClass(typeof(Alignment), true); using (Transaction ts = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction()) { PromptEntityResult per = ed.GetEntity(peo); ObjectId alignmentId = per.ObjectId; Alignment alignment = ts.GetObject(alignmentId, OpenMode.ForWrite) as Alignment; ObjectId sampleLineGroupId = SampleLineGroup.Create("New Group", alignmentId); SampleLineGroup sampleLineGrp = ts.GetObject(sampleLineGroupId, OpenMode.ForWrite) as SampleLineGroup; ObjectId splgrpID = sampleLineGrp.ObjectId; Station[] qwerqwer = alignment.GetStationSet(StationTypes.Major,20); int i = 0; foreach(Station st in qwerqwer) { Point2dCollection points = GetOffsetPoints(alignmentId, st.RawStation); ObjectId slId = SampleLine.Create(String.Format("TestSample Line {0}", i), splgrpID, points); SampleLine sampleLine = ts.GetObject(slId, OpenMode.ForWrite) as SampleLine; sampleLine.Layer = "C-ROAD-SAMP"; i++; } SectionSourceCollection sectionSources = sampleLineGrp.GetSectionSources(); ed.WriteMessage("Number of section sources: {0}\n", sectionSources.Count); ObjectIdCollection surfaceId = new ObjectIdCollection(); foreach (SectionSource sectionSource in sectionSources) { if (sectionSource.SourceType == SectionSourceType.TinSurface || sectionSource.SourceType == SectionSourceType.CorridorSurface) { sectionSource.IsSampled = true; surfaceId.Add(sectionSource.SourceId); } } QTOMaterialList qtoMaterialList = sampleLineGrp.MaterialLists.Add("New Material List"); QTOMaterial qtoMaterial1 = qtoMaterialList.Add("New Material1"); qtoMaterial1.QuantityType = MaterialQuantityType.Fill; QTOMaterialItem qtomaterialitem1 = qtoMaterial1.Add(surfaceId[0]); QTOMaterialItem qtomaterialitem2 = qtoMaterial1.Add(surfaceId[1]); qtomaterialitem1.Condition = MaterialConditionType.Above; qtomaterialitem2.Condition = MaterialConditionType.Below; QTOMaterial qtoMaterial2 = qtoMaterialList.Add("New Material2"); qtoMaterial2.QuantityType = MaterialQuantityType.Cut; qtomaterialitem1 = qtoMaterial2.Add(surfaceId[0]); qtomaterialitem2 = qtoMaterial2.Add(surfaceId[1]); qtomaterialitem1.Condition = MaterialConditionType.Below; qtomaterialitem2.Condition = MaterialConditionType.Above; QTOMaterialGapCollection QTOMGC = qtoMaterial2.MaterialGaps; ts.Commit(); } }

 

2 REPLIES 2
Message 2 of 3
flycoflyco
in reply to: flycoflyco

I found it 

 

System.Guid guidMaterialList = sampleLineGrp.GetMappingGuid(qtoMaterialList.Name); // Guid of QTOMaterialList 


QuantityTakeoffResult QTOresult= sampleLineGrp.GetTotalVolumeResultDataForMaterialList(guidMaterialList); // Access data;

Message 3 of 3
hosneyalaa
in reply to: flycoflyco

@flycoflyco  HI 

Is it possible
You complete the code completely
I tried it and didn't know

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report