Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hi,
I am trying to extract the text from a drawing table and save it to a text file.
I am able to get a hold of the table that I want to extract text from, but struggle to get the text.
Here's what I have so far:
If I leave the "MyTextChar" line I get a fatal error in CREO.
The parameter "&CurrTbl" is a table I select earlier in the code base on a criteria (this part works).
My goal is to replicate the export to CSV, but with a different delimiter and also control better the output filename.
Thanks
Solved! Go to Solution.
@AlexCote wrote:
Hi,
I am trying to extract the text from a drawing table and save it to a text file.
I am able to get a hold of the table that I want to extract text from, but struggle to get the text.
Here's what I have so far:
If I leave the "MyTextChar" line I get a fatal error in CREO.
The parameter "&CurrTbl" is a table I select earlier in the code base on a criteria (this part works).
My goal is to replicate the export to CSV, but with a different delimiter and also control better the output filename.
Thanks
hi all,
Take a look at the code comments for ProWstringToString(...) declaration, read the comments about the size of the resulting string buffer...
the code in question should look somewhat like this:
{ char* my_text_char = NULL; my_text_char = (char*) calloc(sizeof(char), wcslen(CellText[0]) * 3);
assert( NULL != my_text_char); char* p_chr = ProWstringToString( my_text_char, CellText[0]); assert( NULL != p_chr); }
@AlexCote wrote:
Hi,
I am trying to extract the text from a drawing table and save it to a text file.
I am able to get a hold of the table that I want to extract text from, but struggle to get the text.
Here's what I have so far:
If I leave the "MyTextChar" line I get a fatal error in CREO.
The parameter "&CurrTbl" is a table I select earlier in the code base on a criteria (this part works).
My goal is to replicate the export to CSV, but with a different delimiter and also control better the output filename.
Thanks
hi all,
Take a look at the code comments for ProWstringToString(...) declaration, read the comments about the size of the resulting string buffer...
the code in question should look somewhat like this:
{ char* my_text_char = NULL; my_text_char = (char*) calloc(sizeof(char), wcslen(CellText[0]) * 3);
assert( NULL != my_text_char); char* p_chr = ProWstringToString( my_text_char, CellText[0]); assert( NULL != p_chr); }
WOW , thanks ... that worked out fine.
I forgot to mention that I am a complete newbie to C and C++, so let just say it's a pain.
I have experience programming with VB.NET and starting to play with C#, but these C and C++ are a big monster to me 🙂
Been working with ProE for 20 years now, and been thinking for a while to learn this C language to use toolkit.