The problem here is that the API doesn't yet support editing existing (or
placed) iFeatures. So, setting the iFeatureParameterInput.Value property
will work fine if it is done before the placement (the API workflow in which
you first define the various inputs before actually placing the iFeature).
But it will not work if you attempt to set this property on existing
iFeatures.
But, it seems like all you want to do is modify parameters. In which case,
there is hope. You can simply modify the parameter value using the
corresponding Parameter object. This would be the equivalent of modifying
the parameter value in the parameters dialog in the user interface. And do
an update of the document.
Here is some VBA code to help explain (this assumes that the 2nd
iFeatureInput for the feature is a parameter input):
Sub EditiFeat()
Dim odoc As PartDocument
Set odoc = ThisApplication.ActiveDocument
Dim odef As PartComponentDefinition
Set odef = odoc.ComponentDefinition
Dim oFeatDef As iFeatureDefinition
Set oFeatDef = odef.ReferenceComponents.iFeatureComponents(1).Definition
Dim oFeatParamInput As iFeatureParameterInput
Set oFeatParamInput = oFeatDef.iFeatureInputs.Item(2)
oFeatParamInput.Parameter.value = 2
odoc.Update2
End Sub
Hope this helps,
Sanjay-
wrote in message news:5151443@discussion.autodesk.com...
I create an iFeature in my program. but I can't modify its parameters.
here are some codes:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
CComPtr piFeatDef1;
HRESULT hr = (*ppiFeatComp)->get_Definition(&piFeatDef1);
CComPtr piFeatInputs1;
hr = piFeatDef1->get_iFeatureInputs(&piFeatInputs1);
hr = piFeatInputs1->get_Count(&iInpCnt);
for ( int i = 1; i <= iInpCnt; ++i)
{
CComPtr piFeatInp;
hr = piFeatInputs1->get_Item(i, &piFeatInp);
ObjectTypeEnum eType;
hr = piFeatInp->get_Type(&eType);
if (eType == kiFeatureParameterInputObject)
{
double dbl ;
hr = piFeatParaInp->get_Value(dbl); //here succeeds
hr = piFeatParaInp->putt_Value(&dbl);//the value of hr shows that
here fails,
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
by the way, the ifeature I created in the program can be modified in the
user environment.
I have been working on this problem for a long time but in vain. so, please
help me, thank you very much!
null