Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.
Hi,
I've got a problem, I don't know how to call a JLink program with a key. In details, i want to execute my JLink program after put a key of my keyboard.
Is-it possible?
StringBuffer sb = new StringBuffer("..... \n");
sb.append(".....\n");
...
session.RunMacro(sb.toString());
Into the parentesis os StringBuffer, you write the first line of your macro wich begin with "~....."
And after, for the second line at the end of your macro, you, put one line into each sb.append.
And you close by the seesion.RunMacro(sb.toString());
This method has the advantage to delete the existing macro and use only this JLINK program. Your current macro is into the program. I think that is better than call a macro, and this, avoid links. But it's always posible call a macro.
For example :
StringBuffer sb = new StringBuffer("~ Select `main_dlg_cur` `MenuBar1`1 `Analysis`;\n");
sb.append("~ Select `main_dlg_cur` `Analysis.cas_na_measure`;\n");
sb.append("~ Close `main_dlg_cur` `MenuBar1`;\n");
sb.append("~ Close `main_dlg_cur` `Analysis.cas_na_measure`;\n");
sb.append("~ Activate `main_dlg_cur` `psh_na_measure_distance`;\n");
sb.append("~ Open `main_dlg_cur` `Sst_bar.filter_list`;\n");
sb.append("~ Close `main_dlg_cur` `Sst_bar.filter_list`;\n");
sb.append("~ Select `main_dlg_cur` `Sst_bar.filter_list`1 `13`;\n");
session.RunMacro(sb.toString());
Hoping to get you help, and hoping that you can, in your turn, find a solution to my other problem (create a TIFF).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.