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

Weblink (CreoJS) Table.SetText Not Working

AH_10565398
12-Amethyst

Weblink (CreoJS) Table.SetText Not Working

Has anyone had luck with table.settext?  For me it's breaking and a try/catch isn't throwing the error message.  The table is generating up to this point.

I know it's breaking because if I moved the mergeregion after the settext, that doesn't work, and the rest of my code isn't running either.

Any help would be appreciated!  Thanks!

var dwgTable = drawing.CreateTable (tabinstrs);

var topLeft = pfcCreate ("pfcTableCell").Create (1, 1);
var bottomRight = pfcCreate ("pfcTableCell").Create (1, 5);
dwgTable.MergeRegion (topLeft, bottomRight, null);

try {
dwgTable.SetText(1, , "CONN NAME PART NUMBER");
} catch (err) {
  alert("Error setting text in table cell");
}
ACCEPTED SOLUTION

Accepted Solutions

I resolved this myself.  I found the writetextincell function from the JS example.

function writeTextInCell(table /* pfcTable */, row /* integer */,
  col /* integer */, text /* string */)
{
var cell = pfcCreate ("pfcTableCell").Create (row, col);
var lines = pfcCreate ("stringseq");
lines.Append (text);
table.SetText (cell, lines);
}

View solution in original post

1 REPLY 1

I resolved this myself.  I found the writetextincell function from the JS example.

function writeTextInCell(table /* pfcTable */, row /* integer */,
  col /* integer */, text /* string */)
{
var cell = pfcCreate ("pfcTableCell").Create (row, col);
var lines = pfcCreate ("stringseq");
lines.Append (text);
table.SetText (cell, lines);
}
Announcements


Top Tags