Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi there,
I am running a little script to replace drawing formats.
tables = drawing.ListTables();
for (var i=0; i<tables.Count; i++)
{
var table = tables.Item(i);
if (table.CheckIfIsFromFormat(cur_sheet) == true)
{
var table_sel = drawing.GetTable(i);
// table is from format, delete it
drawing.DeleteTable(table, false);
}
}
As it turns out since Creo 2.0 M100 the function CheckIfIsFromFormat(cur_sheet) always returns a "true".
Can anyone confirm this behavior?
I see two ways to fix this:
Option A: PTC imediatly fixes this bug (But I guess this is going to happen in Creo 3.0 at the earliest.)
Option B: finding a way to get the position of the current table (like: "table.IsfromSheet").
Does anyone know, how to get the postion of a table?
Cheers
Matthias
Solved! Go to Solution.
PTC - Support told me that this new behavior is intended.
To Check, if a table is from a format frame (e.g. a company's A4 template) and if a table is the one on the current sheet you want to modify, You have to alter the script above to
if (table.CheckIfIsFromFormat(cur_sheet) == true && table.GetSegmentSheet(0) == cur_sheet )
{
...things to do
}
Works with M110!
This error occurs in Version M90 as well.
M80 seems to work correct.
Bye
Matthias
PTC - Support told me that this new behavior is intended.
To Check, if a table is from a format frame (e.g. a company's A4 template) and if a table is the one on the current sheet you want to modify, You have to alter the script above to
if (table.CheckIfIsFromFormat(cur_sheet) == true && table.GetSegmentSheet(0) == cur_sheet )
{
...things to do
}
Works with M110!