Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Pb JLink call

arno21000

New member
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?

Thanks
 
I think you can but I am not sure how but you can certainly add a menu item in the menu bar and execute your program whenever you click it.
 
Yes, it's what I have done, but, I want to assign with a key of my keyboard (for example "F6") like the execution of a macro.
 
Hi mallo!
Of course, you just have to do that :

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).
 

Sponsor

Articles From 3DCAD World

Back
Top