Skip to main content
18-Opal
July 9, 2019
Solved

How to call a macro in the middle of a program?

  • July 9, 2019
  • 2 replies
  • 4739 views

HI,

 

For synchronous toolkits, the macro is executed after the program function returns and a handle is returned to the creo.

 

Is there no way to use macros in the middle of a program in a synchronous toolkit?
Can you tell me if there is a way to use a macro in the middle of a program in a synchronous toolkit and run the handle back to the toolkit?

 

Since we did not find an API to extract the piping BOM, we need to extract the piping BOM using a macro.
For each model, you must extract all piping BOMs for each simplified representation.

 

If you know how to throw a macro in the middle of code in a synchronous toolkit and get back to the toolkit, Please let me know.

 

Thanks,

 

Warm Regards,
SeonHo

 

PS. attached photo was show what i need[ PIPING BOM]image_1.jpg

Best answer by syalagudri

There is no direct way to do this.

 

I found following work around:

Create separate toolkit DLL application which has macro execute code.

When you want to execute macro than load dll and call the required DLL methods.

 

This is like calling another application from your current application so that macro executes in sync.

API's which can help you are:

ProToolkitTaskExecute

 •ProToolkitDllLoad()
•ProToolkitTaskExecute()
•ProToolkitDllUnload()
•ProToolkitDllIdGet()
•ProToolkitDllHandleGet()

2 replies

14-Alexandrite
July 9, 2019

There is no direct way to do this.

 

I found following work around:

Create separate toolkit DLL application which has macro execute code.

When you want to execute macro than load dll and call the required DLL methods.

 

This is like calling another application from your current application so that macro executes in sync.

API's which can help you are:

ProToolkitTaskExecute

 •ProToolkitDllLoad()
•ProToolkitTaskExecute()
•ProToolkitDllUnload()
•ProToolkitDllIdGet()
•ProToolkitDllHandleGet()

CHASEONHO18-OpalAuthor
18-Opal
July 9, 2019

Thank you for your reply.
But is not this about the interaction between J-Link and the C-Toolkit?
I have tested and return PRO_TK_E_NOT_FOUND

 

PS excute.c call other dll function.  basefunction.c has PRO_DLL_EXPORT function.

14-Alexandrite
July 9, 2019

You are able to load "TASKTEST.dll" in Creo ?

 

after your method executes .. you can see the application  TEMPDLL in Auxiliary application. you should click on in and try to start. if you get any error in starting then you have some issue with DLL. May be the way its built.

18-Opal
July 9, 2019

At the end of the mapkey call the button command again and manage your reentry by a static var or configure the button command.