Question
Group features using VB api
Hello,
I'm trying to create a method that can group any number of UDFGroups in a part. What i have below can find the correct UDFGroups, but once the .Append(feature) is run it returns an error. Have i thought about this the wrong way?
featureType: a string that specifies the wanted UDFgroup name.
nrOf: an int that specifies how many of the instances that should be appended.
public static void CreateGroup(string featureType, int nrOf)
{
IpfcFeatures selectedFeatures = null;
IpfcFeatures features;
features = componentModel.ListFeaturesByType(true,EpfcFeatureType.EpfcFEATTYPE_GROUP_HEAD);
//For each point
for (int i = 0; i <= nrOf; i++)
{
//Search in features
foreach (IpfcFeature feature in features)
{
if (feature.Group.GroupName == $"{featureType}{i}".ToUpper())
{
selectedFeatures.Append(feature); //<--- Error here
break;
}
}
}
componentModel.CreateLocalGroup((CpfcFeatures)selectedFeatures, $"{CatiaTreeModel.pointSet}");
}
Thanks for the help!
Regards

