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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Checking repeat region filter with toolkit

AlexCote
12-Amethyst

Checking repeat region filter with toolkit

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

image.png 

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:

image.png

Thanks

ACCEPTED SOLUTION

Accepted Solutions
AlexCote
12-Amethyst
(To:AlexCote)

I finally ask PTC about this, and they have confirm me that this is not supported by the Toolkit API.

View solution in original post

2 REPLIES 2
AlexCote
12-Amethyst
(To:AlexCote)

I finally ask PTC about this, and they have confirm me that this is not supported by the Toolkit API.

FV
17-Peridot
17-Peridot
(To:AlexCote)

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);

 

Announcements


Top Tags