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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to remove an old drawing format table when changing a drawing format?

jzwijsen
4-Participant

How to remove an old drawing format table when changing a drawing format?

When you change the format of an existing drawing with ProDrawingFormatAdd(), the tables of the old drawing format remain on the drawing.

Any ideas how I can get rid of them? I was thinking about using a drawing table visiting function and perhaps finding out what the parent of the table is?

Regards,

Jan


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.
1 REPLY 1
jzwijsen
4-Participant
(To:jzwijsen)

I got several answers (thanks) all giving the same solution: iterate through all the tables , call the function ProDwgtableIsFromFormat() to determine if the table should be deleted.

Now I run into a new problem: I use a table visiting function, but the command ProDwgtableDelete causes the visiting to stop after the first table has been deleted.

When I blank out the ProDwgtableDeletecommand I can notice in the debugger that then all tables are being visited.

I will now work around the problem by trying ProTablesCollect instead of the visiting function, but I was wondering if anybody had experienced the same problem.

Code:

err = ProDrawingTableVisit(dwgptr->drw, (ProDwgtableVisitAction) remove_table, NULL , (ProAppData) NULL);

..

ProError remove_table(ProDwgtable *table_ptr, ProError filter_status, ProAppData data)
{
..

err = ProDwgtableDelete(table_ptr, 1);
return(PRO_TK_NO_ERROR);
}

Top Tags