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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

TIP: How to read model from windchill workspace

Aravind98
13-Aquamarine

TIP: How to read model from windchill workspace

status = ProBrowserAuthenticate(username, password);
status = ProServersCollect(&aliases);
status = ProArraySizeGet(aliases, &num_servers);
for (i = 0; i < num_servers; i++)
{
status = ProServerUnregister(aliases[i]);
}
ProPath serv;
ProStringToWstring(serv, (char*)workspace.c_str());
ProPath URL;
ProStringToWstring(URL, (char*)serverurlw3.c_str());
ProName wsName;
ProStringToWstring(wsName, (char*)wsNamestr.c_str());
 
status = ProServerRegister(serv, URL, wsName, &aliased_url);
 
status = ProServerActivate(serv);
 
ProPath* p_file_name_array;
ProPath* p_subdir_name_array;
//string da = ".asm,.prt,*.drw";
string da = "*.drw";
ProName namme;
ProStringToWstring(namme, (char*)da.c_str());
status = ProArrayAlloc(0, sizeof(ProPath), 1, (ProArray*)&p_file_name_array);
status = ProArrayAlloc(0, sizeof(ProPath), 1, (ProArray*)&p_subdir_name_array);
status = ProFilesList(aliased_url, namme, PRO_FILE_LIST_LATEST, &p_file_name_array, &p_subdir_name_array);
status = ProArraySizeGet((ProArray*)p_file_name_array,&files);
 
for (i = 0; i < files; i++)
{
char _path[PRO_PATH_SIZE];
ProWstringToString(_path, p_file_name_array[i]);
wstring substring = //"Your Server URL";
wstring result = p_file_name_array[i];
string sPath(result.begin(), result.end());
partPaths.push_back(sPath);
 
size_t pos = result.find(substring);
 
if (pos != wstring::npos) {
result.erase(pos, substring.length());
}
string _name(result.begin(), result.end());
partNames.push_back(_name);
}
6 REPLIES 6

Take a look:

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

@VladimirN @You are funny, you did not check the initiator 😉

Aravind98
13-Aquamarine
(To:RPN)

😂

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

You see in the answer from “PTC”, they are working with message bots 😉

Hello @RPN,

 

Thank you for using PTC Community!

 

Actually, the reply is not from a Bot. In fact "VladimirN" is one of our very active contributor & a Community Champion. 

 

Thanks & Best Regards,

Community Moderation Team.

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

Hello  @vnamboodheri I thought more about your answer, but this answer is no longer available 😀 Probably you can delete ...

For sure (as far of my english) there was an answer, where the chat content was most likely ignored.

But we don't need to discus this further 😉  I appreciate your work!

Announcements


Top Tags