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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Regenrate the model

ddhini
15-Moonstone

Regenrate the model

I have a model.I update some parameter and when i click the Regenerate Button then the model gets regenerated and displayed.But i did something in my tool ,I give input through my tool.Its affect the parameter and updates the value.Now I want to regenerate the model by J-Link.

model mode;

model=Session.getCurrentModel();

model.RegenarateRelation();

model.display();

But it wont regenerate the model.Please help me to solve my problem.Thanks in advance.

ACCEPTED SOLUTION

Accepted Solutions
sjuraj
15-Moonstone
(To:ddhini)

Do following:

Solid solidModel = (Solid) session.GetCurrentModel();

session.SetConfigOption("regen_failure_handling", "resolve_mode");

solidModel.Regenerate(null);

session.SetConfigOption("regen_failure_handling", "no_resolve_mode");

View solution in original post

6 REPLIES 6
sjuraj
15-Moonstone
(To:ddhini)

Regenerate method is allowed only for solid object. You need to cast your Model object to Solid object. Try this:

Solid solidModel = (Solid) session.GetCurrentModel(); //this will cast Model to Solid

RegenInstructions ri = pfcSolid.RegenInstructions_Create(null, null, null);

solidModel.Regenerate(ri);

ddhini
15-Moonstone
(To:sjuraj)

Solid solidModel = (Solid) session.GetCurrentModel(); //this will cast Model to Solid

RegenInstructions ri = pfcSolid.RegenInstructions_Create(null, null, null);

solidModel.Regenerate(ri);

i exactly use the code that you suggest .But it is not working . Don't know what the problem.

sjuraj
15-Moonstone
(To:ddhini)

there must be set regen_failure_handling resolve_mode in the config.pro

If you do not want to keep resolve_mode option after regeneration change it to no_resolve_mode using method session.SetConfigOption("regen_failure_handling", "no_resolve_mode"); after regenerating by j-link app

by the way, you do not have to create regen instructructions, just pass null as parameter in Regenerate method

ddhini
15-Moonstone
(To:ddhini)

Can you please explain briefly .I can't understand

sjuraj
15-Moonstone
(To:ddhini)

Do following:

Solid solidModel = (Solid) session.GetCurrentModel();

session.SetConfigOption("regen_failure_handling", "resolve_mode");

solidModel.Regenerate(null);

session.SetConfigOption("regen_failure_handling", "no_resolve_mode");

ddhini
15-Moonstone
(To:sjuraj)

Thanks a lot skvarka juraj‌.It works fine.

Announcements


Top Tags