cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

ProEngineerConnect() returns PRO_TK_E_NOT_FOUND randomly (Pro/ENGINEER Creo Parametric 7.0.3.0)

Lukasz1
9-Granite

ProEngineerConnect() returns PRO_TK_E_NOT_FOUND randomly (Pro/ENGINEER Creo Parametric 7.0.3.0)

Hello,

I am running Protoolkit customization on 2 different machines. The customization is spawning to the current Creo Parametric instance and fetching the parts and assemblies from Windchill server into local folder.

In the local development environment it is working fine. I can get the files from the server.

When I am running the same customization in the other environment then the function returns PRO_TK_E_NOT_FOUND(-4).

I am using this function:

ProEngineerConnect(NULL, NULL, NULL, NULL, PRO_B_TRUE, 100, &choice, &handle);

 

I also tried to add proe_session_id into and it is the same error. 

The same Creo version is installed, the same Windows 10 version.

 

Can you please com up with some ideas, why it's not working on the other machine?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

step 1.] build pt_async.exe using Toolkit examples

step 2.] run pt_async.exe on problematic machine to verify the problem

step 3.] contact PTC Support

 

Also you can read https://support.ptc.com/appserver/cs/view/solution.jsp?source=Sitecore Article Viewer&art_lang=en&n=CS321596 document and check situation on problematic machine.

 


Martin Hanák

View solution in original post

4 REPLIES 4
VladimirN
24-Ruby II
(To:Lukasz1)

 Hi,

 

Read the following articles:

RPN
17-Peridot
17-Peridot
(To:Lukasz1)

Interesting approach, but why do you span and connect later, it is for sure tricky to determine which one is first, but I guess you have a tag for the first and second session.

ProEngineerConnectionStart(), here you can spawn and connect in one shot (hope the second does not fire number three 🙂 so I would use some args, or a file lock. I think your machines have different hardware, and the port might not ready, kill pro comm msg is another approach. Again, which one is first is a bit tricky in my point of view.

Or the second will start with

 

ProEngineerStart( char* proe_path,char* prodev_text_path ),

 

write the session ID to disk,  the first waits for the id, read this and connect, this would be save.

And if you don’t have a process in between, communication between both will be tricky. But I hope this is solved.

 

extern ProError ProEngineerConnectionStart( char* proe_path,
char* prodev_text_path,
ProProcessHandle *p_handle );

/*
Purpose: Causes the Creo Parametric TOOLKIT program to spawn and connect to a new
Creo Parametric session. ProEngineerDisconnect can be called later
to disconnect from created Creo Parametric session. It is intended
for use in full asynchronous mode.

Input Arguments:
proe_path - The path and file name of the Creo Parametric
executable, or a script that runs it.
prodev_text_path - The path under which the Creo Parametric TOOLKIT message
and menu files are held. This is used in full
asynchronous mode only. Otherwise, pass a null
string.

Output Arguments:
p_handle - A pointer to a process handle to be used in
subsequent calls to Creo Parametric.

Return Values:
PRO_TK_INVALID_PTR - Could not get a valid handle to connect to the
started Creo Parametric.
Other - see returns for ProEngineerStart() and ProEngineerConnect()

Hi,

step 1.] build pt_async.exe using Toolkit examples

step 2.] run pt_async.exe on problematic machine to verify the problem

step 3.] contact PTC Support

 

Also you can read https://support.ptc.com/appserver/cs/view/solution.jsp?source=Sitecore Article Viewer&art_lang=en&n=CS321596 document and check situation on problematic machine.

 


Martin Hanák

Hi,

The hostman and the computername was different.

Thank you for a support.

Br Lukasz

Top Tags