Вы находитесь на странице: 1из 1

Lists are made up of multiple items.

However, you can still extract a single item from a list, if


needed. For this reason, lists are even more beneficial than using multiple nodes. In this exercise, a
graph has been created to create four points and four lines. The output of the
Line.ByStartPointEndPoint node is a list of four lines, but you can extract a single item from the list if
you need to use a single line. For example, you can extract the second entry, which is index 1. To
extract a single item from a list, you can use the List.GetItemAtIndex node. In the node Library,
expand Core > List. Next, under Action, find GetItemAtIndex and then place the node in the
workspace. Move the node to the far right of the graph.This node has two inputs: the list itself and
the index number in the list. Connect the output of the Line.ByStartPointEndPoint node to the list
input of the List.GetItemAtIndex node. For the index input, you need a numeric value to specify the
index number. Double-click the canvas to place a Code Block and enter 1;. Then click in the
canvas, and an output port is created in the Code Block. Connect the output to the index
input. When you do, the line is extracted from the list. Select the List.GetItemAtIndex node, and the
line highlights in the background 3D preview. Remember that lists are very powerful as they can
provide multiple inputs, but you can still extract a single item from a list.

Вам также может понравиться