Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hi,
so I already have a toolkit that iterate trough a drawing tables and check for table with repeat region.
What I would like to do is that while going through the tables, find the one that has a certain filter.
When in CREO I go to the Repeat Region Menu then select Filter and Show, I can see this as my filter: &mdl.param.name == docid
The table is always a single cell table containing my document number and would like to get it.
Anyone knows how to achieve this?
I tried with this method:
p_CurrTbl = &MyTablesCollection[i]; ProWstring **FilterText; error = ProDwgtableCelltextGet(p_CurrTbl, 1, 1, ProParamMode(2), FilterText); if (error == PRO_TK_NO_ERROR) { //Convert the ProWstring text to char char* MyTmpChar = NULL; char NewTmpTxt[50]; MyTmpChar = (char*)calloc(sizeof(char), wcslen(**FilterText) * 3); char* tmp_chr = ProWstringToString(MyTmpChar, **FilterText); if (sizeof(NewTmpTxt) < strlen(tmp_chr) + 1) { goto _END; } strncpy(NewTmpTxt, tmp_chr, sizeof(NewTmpTxt)); ShowMessage(" NewTmpTxt : %s", NewTmpTxt);
But this only returns this:
Thanks
Solved! Go to Solution.
I finally ask PTC about this, and they have confirm me that this is not supported by the Toolkit API.
I finally ask PTC about this, and they have confirm me that this is not supported by the Toolkit API.
This is not an answer to the question but rather a warning for people who may copy/paste the code below.
ProDwgtableCelltextGet call has wrong arguments (in bold) ...
p_CurrTbl = &MyTablesCollection[i]; ProWstring **FilterText; error = ProDwgtableCelltextGet(p_CurrTbl, 1, 1, ProParamMode(2), FilterText); if (error == PRO_TK_NO_ERROR) {...}
The correct call is:
p_CurrTbl = &MyTablesCollection[i]; ProWstring *wstr_arr = NULL; ProParamMode pmode = PRODWGTABLE_FULL; // or PRODWGTABLE_NORMAL error = ProDwgtableCelltextGet(p_CurrTbl, 1, 1, pmode, &wstr_arr); if (error != PRO_TK_NO_ERROR) {
return PRO_TK_GENERAL_ERROR;
}
{
// do something with text ...
} ProWstringproarrayFree(wstr_arr);