cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Suppress feature using Java OTK

VladiSlav
17-Peridot

Suppress feature using Java OTK

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:

  • WARNING: Unattached CUT was detected.
  • Secondary NEW_MODEL regeneration completed successfully.
  • Suppression caused red feature (internal id = 37179) to fail.

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:

  • Suppression caused red feature (internal id = 39839) to fail.

Does anyone know what this error is?

Thanks in advance!

 

Best Regards!

0 REPLIES 0
Top Tags