Пример #1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string title                 = string.Empty;
            string viewportName          = string.Empty;
            bool   drawAxes              = false;
            bool   drawGrid              = false;
            bool   drawGridAxes          = false;
            bool   transparentBackground = true;

            DA.GetData(0, ref title);
            DA.GetData(1, ref viewportName);
            DA.GetData(2, ref drawAxes);
            DA.GetData(3, ref drawGrid);
            DA.GetData(4, ref drawGridAxes);
            DA.GetData(5, ref transparentBackground);

            VieportRh reportDocument = new VieportRh();
            PterodactylGrasshopperBitmapGoo GH_bmp = new PterodactylGrasshopperBitmapGoo();

            PterodactylEngine.Image reportObject = new PterodactylEngine.Image(title, GH_bmp.ReferenceTag);
            using (System.Drawing.Bitmap b = reportDocument.CaptureToBitmap(viewportName, drawAxes, drawGrid, drawGridAxes, transparentBackground))
            {
                GH_bmp.Value      = b.Clone(new Rectangle(0, 0, b.Width, b.Height), b.PixelFormat);
                GH_bmp.ReportPart = reportObject.Create();
                DA.SetData(0, GH_bmp);
            }
        }
Пример #2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string title                 = string.Empty;
            string viewportName          = string.Empty;
            string pathToFile            = string.Empty;
            bool   drawAxes              = false;
            bool   drawGrid              = false;
            bool   drawGridAxes          = false;
            bool   transparentBackground = true;

            DA.GetData(0, ref title);
            DA.GetData(1, ref viewportName);
            DA.GetData(2, ref pathToFile);
            DA.GetData(3, ref drawAxes);
            DA.GetData(4, ref drawGrid);
            DA.GetData(5, ref drawGridAxes);
            DA.GetData(6, ref transparentBackground);

            VieportRh reportDocument = new VieportRh();

            reportDocument.Capture(viewportName, pathToFile, drawAxes, drawGrid, drawGridAxes, transparentBackground);

            string reportPart;
            Image  reportObject = new Image(title, pathToFile);

            reportPart = reportObject.Create();

            DA.SetData(0, reportPart);
        }