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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Error XToolkitBadContext_Regenerate_OTK Java

VladiSlav
17-Peridot

Error XToolkitBadContext_Regenerate_OTK Java

Hello everyone!


When I try to regenerate my assembly, an exception is thrown:

Снимок.PNG

My code:

    .....
    Solid assembly = (Solid)asm;
    assembly.Regenerate(null);
} catch (XToolkitBadContext e) {
    session.UIShowMessageDialog("Error XToolkitBadContext: " + e, null);
}

The documentation for the exception says:

"This exception is thrown when there is an error of type PRO_TK_BAD_CONTEXT in a Creo Parametric TOOLKIT function called by PFC."

But how to fix this error is not said.
Does anyone know the reason?
Thanks in advance.


Respectfully!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi

 

PRO_TK_BAD_CONTEXT   Invalid regen flags and/or combination of regeneration flags if mixed with PRO_REGEN_FORCE_REGEN.

 

You need to define the regeneration flags. You set it to null and that's not possible here.

 

Also there could be a problem with "unlicensed ObjectJava" and the regeneration if the regen_failure_handling config option ist set to no_resolve_mode. So in J-Link and Web-Link you need to set the configoption regen_failure_handling = resolve_mode to regenerate in the free API's. I don't know the feedback that you get if this isn't given.

 

Br,

Eike

View solution in original post

3 REPLIES 3

Hi

 

PRO_TK_BAD_CONTEXT   Invalid regen flags and/or combination of regeneration flags if mixed with PRO_REGEN_FORCE_REGEN.

 

You need to define the regeneration flags. You set it to null and that's not possible here.

 

Also there could be a problem with "unlicensed ObjectJava" and the regeneration if the regen_failure_handling config option ist set to no_resolve_mode. So in J-Link and Web-Link you need to set the configoption regen_failure_handling = resolve_mode to regenerate in the free API's. I don't know the feedback that you get if this isn't given.

 

Br,

Eike

I agree, set config.pro option regen_failure_handling to resolve_mode

See https://www.ptc.com/en/support/article?n=CS294270 


Martin Hanák

Thanks, that helped!

Top Tags