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

Error XToolkitBadContext_Regenerate_OTK Java

SOLVED
Highlighted
Pearl

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!

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Error XToolkitBadContext_Regenerate_OTK Java

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
Highlighted

Re: Error XToolkitBadContext_Regenerate_OTK Java

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

Highlighted

Re: Error XToolkitBadContext_Regenerate_OTK Java

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
Highlighted

Re: Error XToolkitBadContext_Regenerate_OTK Java

Thanks, that helped!

Announcements