Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hello everyone!
I am trying to suppress an feature in a part using Java OTK.
I walked in two ways.
First:
Solid currSolid = (Solid)currModel;
Features allFeats = currSolid.ListFeaturesByType(true, FeatureType.FEATTYPE_CURVE);
session.UIShowMessageDialog(allFeats.get(0).GetName(), null);
SuppressOperation so = allFeats.get(0).CreateSuppressOp();
so.SetClip(true);
FeatureOperations fo = FeatureOperations.create();
fo.insert(0, so);
pfcGlobal.GetProESession().SetConfigOption("regen_failure_handling", "resolve_mode");
currSolid.ExecuteFeatureOps(fo, null);
} catch (XToolkitNotValid e) {
session.UIShowMessageDialog("Error XToolkitNotValid: " + e, null);
} catch (XToolkitSuppressedParents e) {
session.UIShowMessageDialog("Error XToolkitSuppressedParents: " + e, null);
} catch (XToolkitBadContext e) {
session.UIShowMessageDialog("Error XToolkitBadContext: " + e, null);
The following messages appear in the lower left corner of Creo:
Second:
WSolid currWsolid = (WSolid)currModel;
Features allFeats = currWsolid.ListFeaturesByType(true, FeatureType.FEATTYPE_CURVE);
FeatSuppressOrDeleteOptions SuppOpts = FeatSuppressOrDeleteOptions.create();
SuppOpts.append(FeatSuppressOrDeleteOption.FEAT_SUPP_OR_DEL_NO_OPTS );
intseq feat_ids = intseq.create();
feat_ids.append(allFeats.get(0).GetId());
currWsolid.SuppressFeatures(feat_ids, SuppOpts, null);
session.UIShowMessageDialog(allFeats.get(0).GetName(), null);
The following messages appear in the lower left corner of Creo:
Does anyone know what this error is?
Thanks in advance!
Best Regards!