TIP: How to read model from windchill workspace
May 09, 2024
02:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
May 09, 2024
02:08 AM
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);
}
Labels:
- Labels:
-
ProToolkit
- Tags:
- c++
- creo toolkit
6 REPLIES 6
May 09, 2024
11:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
May 09, 2024
11:00 AM
Take a look:
- "How to read Workspace model": https://community.ptc.com/t5/Customization/how-to-read-Workspace-model/td-p/943488
- "How to read parameters of model which is present in the Windchill workspace in Creo Parametric through Toolkit": https://www.ptc.com/en/support/article/CS372943
May 09, 2024
01:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
May 09, 2024
01:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
May 09, 2024
01:55 PM
😂
May 15, 2024
03:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
May 15, 2024
03:19 AM
You see in the answer from “PTC”, they are working with message bots 😉
May 16, 2024
09:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
May 16, 2024
12:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
May 16, 2024
12:08 PM
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!
![](/skins/images/695EE5AD3E567050FEDD72575855ED93/ptc_skin/images/icon_anonymous_message.png)