I have a parameter in a ModelBuilder model I am running that defines the geodatabase that all of the temporary files will be written to. I need to be able to call that variable in a field calculator that I run at one point. I used arcpy.da.TableToNumpyArray and need that geodatabase to be called in as the path to find the file / field. I have what I believe should be functioning code below but I keep getting a syntax error at line 3.
So I got it to work this morning. None of the Model Builder variables need to be defined in Python; the error was a result of the file path using single black slashes while Python needs double or forward slashes for file paths.
Pipe_array = arcpy.da.TableToNumPyArray(r"%GDB Path%" + r"\Service_Pipes_%Value%", "SHAPE_Length")
Converting the variable to a raw string seemed to resolve the black slash issue.