Beispiel #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)
        {
            // Declare a variable for the input String
            Topologic.Edge edge1 = null;
            Topologic.Edge edge2 = null;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref edge1))
            {
                return;
            }
            if (!DA.GetData(1, ref edge2))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (edge1 == null)
            {
                return;
            }
            if (edge2 == null)
            {
                return;
            }

            IList <Topologic.Vertex> vertices = edge1.SharedVertices(edge2);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetDataList(0, vertices);
        }
Beispiel #2
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)
        {
            // Declare a variable for the input String
            Topologic.Edge edge = null;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref edge))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (edge == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            Topologic.Vertex vertex = edge.StartVertex;

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, vertex);
        }
        /// <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)
        {
            // Declare a variable for the input String
            Topologic.Graph  graph     = null;
            Topologic.Vertex vertex1   = null;
            Topologic.Vertex vertex2   = null;
            double           tolerance = 0.0;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref graph))
            {
                return;
            }
            if (!DA.GetData(1, ref vertex1))
            {
                return;
            }
            if (!DA.GetData(2, ref vertex2))
            {
                return;
            }
            if (!DA.GetData(3, ref tolerance))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (graph == null)
            {
                return;
            }
            if (vertex1 == null)
            {
                return;
            }
            if (vertex2 == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            Topologic.Edge edge = graph.Edge(vertex1, vertex2, tolerance);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, edge);
        }