Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
I'm building a Jlink app.
I need that, the Jlink app run a specific macro in the middle of my code. First I need to select a part to show a layer of the selected part. It's working fine!
Then I need to run a macro, doing the session.RunMacro function. And it also works, then after this, i need to continue my code, and do some other actions. But don't understand why, but all of the jlink actions are running in sequence, the session.RunMacro is ignored, and executed, only at the end of my code! I would need this to be executed when I need to be executed.
Any idea?
@T_F wrote:
I'm building a Jlink app.
I need that, the Jlink app run a specific macro in the middle of my code. First I need to select a part to show a layer of the selected part. It's working fine!
Then I need to run a macro, doing the session.RunMacro function. And it also works, then after this, i need to continue my code, and do some other actions. But don't understand why, but all of the jlink actions are running in sequence, the session.RunMacro is ignored, and executed, only at the end of my code! I would need this to be executed when I need to be executed.
Any idea?
Hi,
please read https://community.ptc.com/t5/Customization/JLink-Question/td-p/84229 discussion.
RunMacro() is always run at the and of command. You can alternativly use ExecuteMacro() but it is limited only to WSession object which is part of paid java object toolkit. But, you can split your command into 2 separate command and then you can run your seccond command from macro. So:
your actual code:
Command 1 class
code
RunMacro()
code
new code:
Command 1 class
code
code RunMacro("~ Command your_second_command_name ;")
Command 2 class
rest of code
Note that command name is string name of your command when creating command on session object. You will also need to find good solution how to share data between your 2 commands. I suggest to create one object which will be added to your command class in constructor.