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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

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

ddhini
14-Alexandrite

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
12-Amethyst
(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
14-Alexandrite
(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?

Top Tags