Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pro/TOOLKIT-Get filename of active window

  • Thread starter Thread starter MartyP
  • Start date Start date
M

MartyP

Guest
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
 
do you mean you want to get the full path filename?
Or just the current opened model name?
 
I want to get the full path of the filename.
 
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
 
Hi Kishore,

I am working at the East coast of the US.

Regards,
Marty
 

Part and Inventory Search

Sponsor

Back
Top