Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
I am using Creo Parametric Release 6.0 and Datecode6.0.6.0
Has any Weblink api to redifine coordinate system's origin?
If not, how to use macro command to process. Here is a problem that I can't change selectonbuffer after once RunMacro. And then cant't select the new reference for coordinate by code.
Code:
let selection1;
let selection2;
...
let selBuffer = session.CurrentSelectionBuffer;
selBuffer.Clear();
selBuffer.AddSelection(selection1);
session.RunMacro('~ Command `ProCmdReroute` ');
selBuffer.Clear(); <-thorws pfc error
selBuffer.AddSelection(selection2);
session.RunMacro('~ Activate `Odui_Dlg_00` `stdbtn_1`');
I notice you have a session.RunMacro() in the "middle" of your code. The session.RunMacro()'s will not run until the end of your code. Running multiple session.RunMacro()'s will give suprising results...
Weblink and jlink session.RunMacro() only runs when control is returned to Creo Parametric. From the weblink api docs:
void RunMacro (string Macro)
Runs the specified macro.
Macros may only run when control is returned to Creo Parametric. If control is maintained by a J-Link program, the macro will be stored for later running.
Parameters:
Macro
The macro to run
See also these discussions:
https://community.ptc.com/t5/Customization/JLink-Question/td-p/84229