Create Random Points fails with ERROR 999999: Error executing function.

Discussion created by eddof13 on Mar 16, 2011

I am having trouble running some arcobjects code that calls create random points. I would not be doing this in arcobjects, but I am suffering with the same issue using arcpy as seen here: http://forums.arcgis.com/threads/12782-Python-scripting-and-creating-random-points?p=85866&viewfull=1#post85866

Any help as to the cause of this error would be greatly appreciated (Indeed, an official confirmation that create random points is bugged would also be appreciated).

code excerpt:
Geoprocessor gp = new Geoprocessor();
gp.OverwriteOutput = true;
gp.LogHistory = true;

//Input parameters
string constrainingFeatures = "lineRoute";
string outFeatures = "test";
string workspace = "\\\\\\output\\Routes.gdb";

//Open workspace
IWorkspaceFactory workspaceFactory = new FileGDBWorkspaceFactoryClass();
IWorkspace gdb;
    gdb = workspaceFactory.OpenFromFile(workspace, 0);
    Console.WriteLine("Unable to open geodatabase");
IFeatureWorkspace fws = (IFeatureWorkspace)gdb;

//Get constraining feature class
IFeatureClass fc = fws.OpenFeatureClass(constrainingFeatures);

//Create random points - DOES NOT WORK WITH A PATH TO WORKSPACE OR the IFeatureWorkspace
//CreateRandomPoints crp = new CreateRandomPoints(fws, outFeatures);
CreateRandomPoints crp = new CreateRandomPoints(workspace, outFeatures);
crp.number_of_points_or_field = "2000";
crp.minimum_allowed_distance = "1 Meter";

//DOES NOT WORK WITH A PATH TO cfc OR the IFeatureClass
//crp.constraining_feature_class = fc;
crp.constraining_feature_class = workspace + "\\" + constrainingFeatures;

//this out_feature_class does not seem to make a difference
crp.out_feature_class = workspace + "\\" + outFeatures;

    gp.Execute(crp, null);

Here is the log:
<ResultView Tool="Create Random Points">
<CommandLine>CreateRandomPoints_management \\\Output\Routes.gdb \\\Output\Routes.gdb\test \\\Output\Routes.gdb\lineRoute '0 0 250 250' 2000 '1 Meters' POINT 0</CommandLine>
<ToolSource>C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Data Management Tools.tbx\Feature Class\CreateRandomPoints</ToolSource>
<StartTime>Wed Mar 16 14:31:01 2011</StartTime>
<Parameter Label="Output Location" Type="Dataset">\\\Output\Routes.gdb</Parameter>
<Parameter Label="Output Point Feature Class" Type="Scalar">\\\Output\Routes.gdb\test</Parameter>
<Parameter Label="Constraining Feature Class" Type="Dataset">\\\Output\Routes.gdb\lineRoute</Parameter>
<Parameter Label="Constraining Extent" Type="Scalar">0 0 250 250</Parameter>
<Parameter Label="Number of Points [value or field]" Type="Scalar">2000</Parameter>
<Parameter Label="Minimum Allowed Distance [value or field]" Type="Scalar">1 Meters</Parameter>
<Parameter Label="Create Multipoint Output" Type="Scalar">false</Parameter>
<Parameter Label="Maximum Number of Points per Multipoint" Type="Scalar">0</Parameter>
<Parameter Label="Output Feature Class" Type="Dataset">\\\Output\Routes.gdb\\\\Output\Routes.gdb\test</Parameter>
<Environment Label="Precision For New Coverages">SINGLE</Environment>
<Environment Label="Auto Commit">1000</Environment>
<Environment Label="Minimize memory use during analysis on terrains">false</Environment>
<Environment Label="Compression">LZ77</Environment>
<Environment Label="Coincident Points">MEAN</Environment>
<Environment Label="Random number generator">0 ACM599</Environment>
<Environment Label="Raster Statistics">STATISTICS 1 1</Environment>
<Environment Label="Level Of Comparison Between Projection Files">NONE</Environment>
<Environment Label="Output has Z Values">Same As Input</Environment>
<Environment Label="Maintain fully qualified field names">true</Environment>
<Environment Label="Tile Size">128 128</Environment>
<Environment Label="Pyramid">PYRAMIDS -1 NEAREST DEFAULT 75</Environment>
<Environment Label="Default TIN storage version">CURRENT</Environment>
<Environment Label="Output Spatial Grid 1">0</Environment>
<Environment Label="Cell Size">MAXOF</Environment>
<Environment Label="Output has M Values">Same As Input</Environment>
<Environment Label="Output Spatial Grid 2">0</Environment>
<Environment Label="Output Spatial Grid 3">0</Environment>
<Environment Label="Maintain Spatial Index">false</Environment>
<Environment Label="Precision For Derived Coverages">HIGHEST</Environment>
<Error>ERROR 999999: Error executing function.</Error>
<Error>Failed to execute (CreateRandomPoints).</Error>
<EndTime>36.00 seconds)</EndTime>

The only other output message is:
Error HRESULT E_FAIL has been returned from a call to a COM component.