For each with Python Script

Hello, im trying to do a python script that for each grid in the IN[0] i wanna add more one in the var “name”

Exemple:

for each Revit.Element.Grid in grid
name = +1

but i already try most everything and i can’t made it work -_-’

can someone help to understand that?

What i already have tried:

  1. grid = IN[0]
    lista [grid]
    name = 0

    for grid in lista
    name = +1

  2. grid = IN[0]
    name = 0

    for Autodesk.Element.Grid in grid
    name = +1

  3. grid = IN[0]
    name = 0

    for grid
    name = +1

This should do the incrementing.

# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# The inputs to this node will be stored as a list in the IN variables.
grid = IN[0]
name = 0
# Place your code below this line
for i in grid:
	name+=1
	
# Assign your output to the OUT variable.
OUT = name
1 Like

Thanks man, help a lot