I took the function out of the picture for testing and found two things. If you do use the function, you are assigning the outFc in two places...I would leave it in the function since that is the proper format (that is, you do need the \\ , but there are other ways to do this.
The other issue was the syntax for the CreateFeatureclass_Management, at least when I ran it with a sample line FC (with an Albers projection). Create Feature Class—Help | ArcGIS for Desktop
CreateFeatureclass_management (out_path, out_name, {geometry_type}, {template},
{has_m}, {has_z}, {spatial_reference}, {config_keyword}, {spatial_grid_1},
{spatial_grid_2}, {spatial_grid_3}
Try this: (the "#" in my CreateFeatureclass line mean, "use defaults")
import arcpy, os
inFc = arcpy.GetParameterAsText(0)
workspace = arcpy.GetParameterAsText(1)
fcName = arcpy.GetParameterAsText(2)
# Create Points at Vertices
def VerticesToPoints(inFC, workspace, fcName):
outFc = workspace + "\\" + fcName
dsc = arcpy.Describe(inFC)
sr = dsc.spatialReference
#arcpy.CreateFeatureclass_management(workspace, fcName, "POINT", sr)
arcpy.CreateFeatureclass_management(workspace, fcName,"POINT", "#", "#", "#", sr)
with arcpy.da.InsertCursor(outFc, "SHAPE@") as iCurs:
with arcpy.da.SearchCursor(inFc, "SHAPE@") as sCurs:
for geom, in sCurs:
for i in range(geom.partCount):
part = geom.getPart(i)
for pnt in part:
if not pnt:
continue
row = (pnt,)
iCurs.insertRow(row)
del iCurs
del sCurs
return outFc
#outFc = workspace + fcName
#outFc = workspace + "\\" + fcName
VerticesToPoints(inFc, workspace, fcName)
arcpy.SetParameter(3, outFc)
I'm not sure why you were getting and error with the spatial reference, but you don't mention the version of the software you are using, so maybe that is an issue. But if you still have issues, run the lines without the function first to make sure it is working with your inputs and outputs. Add a arcpy.Exists(<variable>) once in a while to make sure you don't have that issue (like if you used line 25 in the original script (that I posted for you). Also, sprinkle in plenty of print or arcpy.AddMessage to make sure the variables are what you expected. Those are all just good habits to get into when it comes to debugging in general (and of course...add comments. You may know what it does now...but years from now, you will appreciate the effort you put in now.)
Hope this works for you