Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

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

flycoflyco
Enthusiast

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

flycoflyco
Enthusiast
Enthusiast

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(); } }

 

0 Likes
Reply
918 Views
2 Replies
Replies (2)

flycoflyco
Enthusiast
Enthusiast

I found it 

 

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


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

0 Likes

hosneyalaa
Advisor
Advisor

@flycoflyco  HI 

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

0 Likes