Grasshopper

algorithmic modeling for Rhino

Hi all,

I need the guids for curve points, but they come out empty in my code. How do I do that?Not working Code:

        protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
        {
            pManager.AddCurveParameter("crv", "crv", "crv", GH_ParamAccess.list);
            pManager.AddPointParameter("crvPoints", "crvPoints", "crvPoints", GH_ParamAccess.list);
            pManager.AddPointParameter("point", "point", "point", GH_ParamAccess.item);
        }
      
        protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
        {
            pManager.AddTextParameter("crvGuid", "crvGuid", "crvGuid", GH_ParamAccess.list);
            pManager.AddTextParameter("PointsGuid", "PointsGuid", "PointsGuid", GH_ParamAccess.list);
            pManager.AddTextParameter("PointGuid", "PointGuid", "PointGuid", GH_ParamAccess.item);
        }
       
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            List<IGH_GeometricGoo> crvGeo = new List<IGH_GeometricGoo>();
            List<IGH_GeometricGoo> pointsGeo = new List<IGH_GeometricGoo>();
            IGH_GeometricGoo pointGeo = null;

            DA.GetDataList(0, crvGeo);
            DA.GetDataList(1, pointsGeo);
            DA.GetData(2, ref pointGeo);

            List<Guid> crvGuid = new List<Guid>();
            List<Guid> pointsGuid = new List<Guid>();

            foreach (IGH_GeometricGoo geo in crvGeo)
            {
                crvGuid.Add(geo.ReferenceID);
            }

            foreach (IGH_GeometricGoo geo in pointsGeo)
            {
                pointsGuid.Add(geo.ReferenceID); //Not working
            }

            DA.SetDataList(0, crvGuid);
            DA.SetDataList(1, pointsGuid);
            DA.SetData(2, pointGeo.ReferenceID);
        }

Views: 388

Replies to This Discussion

pointGeo here is not a referenceGeometry,and you can not get the ReferenceID.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service