Exemple #1
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            var   id          = "";
            var   data        = "";
            Curve innerBounds = null;
            Curve outerBounds = null;

            DA.GetData(0, ref id);
            DA.GetData(1, ref data);
            DA.GetData(2, ref innerBounds);
            DA.GetData(3, ref outerBounds);

            var req = new CiceroRequest(data, innerBounds, outerBounds);

            SolutionManifest res = Parse.Request(req);

            res.RunContainment();
            res.RunVerbs();
            res.RunAdverbs();

            var dwg = Compose.Drawing(res);

            dwg.Build();

            var path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\cicero\\svg\\" + id + ".svg";

            io.File.WriteAllText(path, dwg.SvgText.ToString());

            var crvs = new List <Curve>();

            res.BoxElements.ForEach(x => x.InputSegments.ForEach(y => crvs.Add(y)));

            DA.SetDataList(0, res.InputLines);
        }