Community Tip - Help us improve the PTC Community by taking this short Community Survey!
I'm running a macro to regenerate the model after parameters are set, but sometimes it freezes until I end my asynchronous jlink program. I tried adding connection.EventProcess() commands after everything but it doesn't help.
p = creo.solid.GetParam("A");
p = creo.solid.GetParam("NAME");
session.RunMacro("~ Command `ProCmdRegenPart` ");
I've also tried to disconnect and reconnect in order to reset the state to no avail.
Ah I fixed it. I was running a regenerate macro in the first place instead of
Because it was throwing an inexplicable 'badcontext' error message. But re-reading the documentation, it says:
"Pro/ENGINEERWildfire5.0introducestheNo-Resolvemode,whereinifa modelandfeatureregenerationfails,failedfeaturesandchildrenoffailedfeatures arecreatedandregenerationofotherfeaturescontinues.However,J-Linkdoesnot supportregenerationinthismode.Themethod pfcSolid.Solid.Regeneratethrowsanexception pfcExceptions.XToolkitBadContext,ifPTCCreoParametricis runningintheNo-Resolvemode.TocontinuewiththePro/ENGINEERWildfire 4.0behaviorintheResolvemode,settheconfigurationoptionregen_ failure_handlingtoresolve_modeinthePTCCreoParametricsession."
Adding this config option allowed the original code to run.