Failed to regenerate Component placement while deleting a feature in Assembly using Jlink
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Labels:
-
Assembly Design
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
