private ConceptualPlot BuildConceptualPlot(FoundationInput input, Document doc, Transaction trans)
        {
            ConceptualPlot plot;

            DataService.Current.PopulateStoreTypes();
            SoilProperties props = DataService.Current.GetStore <StructureDocumentStore>(doc.Name).SoilProperties;

            props.ExistingGroundSurfaceName = input.ExistingGround;
            props.ProposedGroundSurfaceName = input.ProposedGround;

            ObjectId obj = doc.Database.GetObjectId(false, new Handle(146034), 0);

            DBObject ent = trans.GetObject(obj, OpenMode.ForWrite);

            PolylineDrawingObject polyObject = new PolylineDrawingObject(ent as Polyline);

            plot = new ConceptualPlot(polyObject);

            CivSurface existingGround = GetSurface(props.ExistingGroundSurfaceName);
            CivSurface proposedGround = GetSurface(props.ProposedGroundSurfaceName);

            plot.EstimateFoundationLevel(existingGround, proposedGround, props);
            plot.RenderFoundations(props.DepthBands, null);
            return(plot);
        }
        public bool ConvertPolylineToPlotResident()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;

            ConceptualPlot plot;

            using (Transaction trans = doc.TransactionManager.StartTransaction())
            {
                ObjectId obj = doc.Database.GetObjectId(false, new Handle(146034), 0);

                DBObject ent = trans.GetObject(obj, OpenMode.ForWrite);

                PolylineDrawingObject polyObject = new PolylineDrawingObject(ent as Polyline);
                plot = new ConceptualPlot(polyObject);
            }

            return(true);
        }
        //TODO: Renable later

        /*[Test]
         * public void VerifyGenerate()
         * {
         *  StringAssert.AreEqualIgnoringCase("jpp_plot_boundary", RunTest<string>(nameof(VerifyGenerateResident)));
         * }*/

        public string VerifyGenerateResident()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;

            ConceptualPlot plot;

            using (Transaction trans = doc.TransactionManager.StartTransaction())
            {
                BlockTable acBlkTbl =
                    trans.GetObject(doc.Database.BlockTableId, OpenMode.ForRead) as BlockTable;

                BlockTableRecord acBlkTblRecRec =
                    trans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as
                    BlockTableRecord;


                Polyline acPoly = new Polyline();
                acPoly.AddVertexAt(0, new Point2d(2, 4), 0, 0, 0);
                acPoly.AddVertexAt(1, new Point2d(4, 2), 0, 0, 0);
                acPoly.AddVertexAt(2, new Point2d(6, 4), 0, 0, 0);
                acPoly.Closed = true;

                acBlkTblRecRec.AppendEntity(acPoly);
                trans.AddNewlyCreatedDBObject(acPoly, true);

                PolylineDrawingObject polyObject = new PolylineDrawingObject(acPoly);
                plot = new ConceptualPlot(polyObject);
                plot.Generate();
                trans.Commit();
            }

            using (Transaction trans = doc.TransactionManager.StartTransaction())
            {
                Entity baseEntity = trans.GetObject(plot.BaseObject, OpenMode.ForRead) as Entity;
                return(baseEntity.Layer);
            }
        }
 public ConceptualPlot(PolylineDrawingObject drawingObject) : base(drawingObject)
 {
     _depth = new NHBC2020FoundationDepth();
 }