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.

Pro/TOOLKIT-Get filename of active window

MartyP

New member
Hi,

Using Pro/TOOLKIT, how would I get the filename that is associated with the currently active window in Pro/E?

I am completely new to Pro/E and Pro/TOOLKIT btw. I tried using ProWindowCurrentGet and ProWindowURLGet, but as I expected this just gets the URL of the Pro/E browser. I can't find the functions for getting the filenames.

Please let me know if I can provide more information.

Thanks,
Marty
 
Hello Matry,


You can get from this API ProMdlCurrentGet() ,ProMdlDataGet()


typedef struct pro_object_info
{
wchar_t name[80];
wchar_t type[10];
wchar_t path[PRO_PATH_SIZE];
wchar_t device[20];
wchar_t host[80];
int version;
int subclass;
} ProMdldata;



Once you get the ProMdlData handle you retrieve the information of the path and name,directory in which the path given....if you need total path you need to string manuplation function to club the things.


With regards,


Kishore V
 
Hello Kishore,

Thanks for pointing me to those functions! They worked great. I concatenated the parameters of the ProMdlData to get the filename.

The only issue I noticed was with the "version" parameter of ProMdlData. If a Pro/E file is backed up and given the version number "1" (and an extension of ".1") and then the extension ".1" is deleted and Pro/E is restarted, the "version" attribute will still be reported as "1", which makes it harder to determine the path, since I normally concatenate a "." and the version number when the version is greater than 0.

Warm regards,
Marty
 
Hello Matry,


I never encountered with version,you corss check the version by running on the current version of the Pro-Engineer file.Let check it is giving the correct version for the opened part or not.


Let me check and let you know about it.Where are you working?


With regards,


Kishore V
 

Sponsor

Back
Top