Skip to main content
16-Pearl
June 3, 2014
Solved

Creo Weblink: CheckIfIsFromFormat(int) not working

  • June 3, 2014
  • 1 reply
  • 1872 views

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


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
Best answer by Mat

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!

1 reply

Mat16-PearlAuthor
16-Pearl
June 3, 2014

This error occurs in Version M90 as well.

M80 seems to work correct.

Bye

Matthias

Mat16-PearlAuthorAnswer
16-Pearl
June 24, 2014

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!