Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Translate the entire conversation x

Failed to regenerate Component placement while deleting a feature in Assembly using Jlink

ddhini
15-Moonstone

Failed to regenerate Component placement while deleting a feature in Assembly using Jlink

I have an assembly file .I get all the Components inside the assembly and delete my one ofthe components from assembly using the following code(Jlink)

 

 Session session=pfcGlobal.GetProESession();
 //GET MODEL
 Model mod=session.GetCurrentModel();
Model model = null;
 Assembly asm = (Assembly) session.GetActiveModel();
Features components = asm.ListFeaturesByType(null, FeatureType.FEATTYPE_COMPONENT);
//delete component from Assembly ComponentFeat component = (ComponentFeat) components.get(2); DeleteOperation featDeleteOp = component.CreateDeleteOp(); FeatureOperations featOperations = FeatureOperations.create(); featOperations.insert(0, featDeleteOp); Assembly curAsm = (Assembly) session.GetCurrentModel(); String origOption = session.GetConfigOption("regen_failure_handling"); session.SetConfigOption("regen_failure_handling", "resolve_mode"); RegenInstructions regenInstrs = pfcSolid.RegenInstructions_Create(true, null, null); curAsm.ExecuteFeatureOps(featOperations, regenInstrs); session.SetConfigOption("regen_failure_handling", origOption); asm.Display();

But using this code will give an information Failed to regenerate Component placement. please help me to solve this issue.Any help will be appreciated.

2 REPLIES 2
GabrielZaha
13-Aquamarine
(To:ddhini)

The most obvious reason I can think of is that the component or feature that you are trying to delete has childrens. Deleting the parent will cause the childrens to fail.

One suggestion that I can make is to set regen_failure_handling option to no_resolve_mode. This way after the JLink application returns you can go in the model and investigate the failures.

ddhini
15-Moonstone
(To:GabrielZaha)

Gabrielzaha,

All components inside are constrined one over another.So i want to delete all the Constrint in a model using jlink.Is this possible?

Announcements
NEW Creo+ Topics: Real-time Collaboration

Top Tags