I was asked about a seemingly simple line of code in one of my scripts and I didn't have an immediate answer. After a few pages of g-search, I'm still a bit stumped, but not afraid to ask for the answer!
facFC = arcpy.CreateFeatureclass_management("in_memory", "facFC", "POINT")[0]
What exactly is the [0] at the end of this statement for?
There's examples of having it there and other examples it's not found.
Thanks!
Create Feature Class—Data Management toolbox | ArcGIS Desktop
the [0] is a slice, meaning get the first, which in your case would be the first... first of what is sketchy.
The above is the preferred by me, approach,
out_path…. the location where the featureclass is going
out_name .. the name to give the featureclass
geometry_type… point, line, polygon stuff
template … if you have a featureclass that you want to use for emulation
has_m, has_z - well? do you want them?
spatial_reference - specify it now! or you have to use the define projection tool
the rest... might be important but not critical if saving to a gdb which would have the info anyway.
Note! there is no ….. blah = CreateFeatureclass
because everything is inside the function