Could anyone kindly let me know how I can create a new FeatureClass as output from the IGPParameter. I have a requirement where I need to output a feature class with geometries. They are calcuated based on input ids. The source for the data is not part of the Input parameters.
From what I have looked into so far IGPParameter3 has a property for "Schema" which can be used to define a complete structure for the output. Below is the code I have in the ParameterInfo property.
<SPAN class="keyword token">public</SPAN> IArray ParameterInfo
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">get</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN>
<SPAN class="keyword token">var</SPAN> targetFeatureClass <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IGPParameterEdit3<SPAN class="punctuation token">)</SPAN><SPAN class="token function">CreateParameter</SPAN><SPAN class="punctuation token">(</SPAN>
<SPAN class="string token">"TargetFeatureClass"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"Target Points FeatureClass"</SPAN><SPAN class="punctuation token">,</SPAN>
esriGPParameterDirection<SPAN class="punctuation token">.</SPAN>esriGPParameterDirectionOutput<SPAN class="punctuation token">,</SPAN>
esriGPParameterType<SPAN class="punctuation token">.</SPAN>esriGPParameterTypeRequired<SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">(</SPAN>IGPDataType<SPAN class="punctuation token">)</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">DEFeatureClassTypeClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">DEFeatureClassClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Feature type, geometry type, and fields all come from the first dependent—the input features.</SPAN>
IGPFeatureSchema outSchema <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">GPFeatureSchemaClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
outSchema<SPAN class="punctuation token">.</SPAN>FeatureType <SPAN class="operator token">=</SPAN> esriFeatureType<SPAN class="punctuation token">.</SPAN>esriFTSimple<SPAN class="punctuation token">;</SPAN>
outSchema<SPAN class="punctuation token">.</SPAN>GeometryType <SPAN class="operator token">=</SPAN> ESRI<SPAN class="punctuation token">.</SPAN>ArcGIS<SPAN class="punctuation token">.</SPAN>Geometry<SPAN class="punctuation token">.</SPAN>esriGeometryType<SPAN class="punctuation token">.</SPAN>esriGeometryPoint<SPAN class="punctuation token">;</SPAN>
IFieldsEdit fieldsEdit <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">FieldsClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
IFieldEdit fieldEdit <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">FieldClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
fieldEdit<SPAN class="punctuation token">.</SPAN>Name_2 <SPAN class="operator token">=</SPAN> <SPAN class="string token">"ID2"</SPAN><SPAN class="punctuation token">;</SPAN>
fieldEdit<SPAN class="punctuation token">.</SPAN>Type_2 <SPAN class="operator token">=</SPAN> esriFieldType<SPAN class="punctuation token">.</SPAN>esriFieldTypeString<SPAN class="punctuation token">;</SPAN>
fieldsEdit<SPAN class="punctuation token">.</SPAN><SPAN class="token function">AddField</SPAN><SPAN class="punctuation token">(</SPAN>fieldEdit<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Add the additional field to the derived output.</SPAN>
IFields fields <SPAN class="operator token">=</SPAN> fieldsEdit <SPAN class="keyword token">as</SPAN> IFields<SPAN class="punctuation token">;</SPAN>
outSchema<SPAN class="punctuation token">.</SPAN>AdditionalFields <SPAN class="operator token">=</SPAN> fields<SPAN class="punctuation token">;</SPAN>
targetFeatureClass<SPAN class="punctuation token">.</SPAN>Schema <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>IGPSchema<SPAN class="punctuation token">)</SPAN>outSchema<SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Can anyone let me know who I can use the above information to create a new FeatureClass within the Execute method. There is no dependency and I cannot use clone method.