0

The company I work for has its own drawing style and settings. I am trying to get some information from it like its BOM table dor example. The issue I face is that even through I can see the BOM table on the screen when I loop through the whole drawing ‘sheets >> views >> tables’ there is no table. I try to use search function from Catia and no content can be found either.

Does anyone have some suggestions on things I should try to extract this info?

N.TW12
  • 241
  • 2
  • 11
  • Can you manual select the table? Is it really a table (maybe only some texts and lines)? – Shrotter Mar 07 '23 at 20:34
  • @Shrotter, I cannot select the table by click on it. If I select the Sheet (on the left side tree), then it gets highlighted. I also tried to get all of the text contents to see if I can get some texts but none of the text shows - using .View.Texts.Get(index) – N.TW12 Mar 08 '23 at 00:03
  • Have you checked the background? Consider to ask your catia admin what type the BOM is. (Why _Get_ and not _Item_?) – Shrotter Mar 08 '23 at 05:14
  • @Shrotter, sorry I mean Item, not get (typo using it on my phone). I already checked the background, nothing there. The company is very big and IT won't talk to me regarding anything automation related. I do it for my own good. – N.TW12 Mar 08 '23 at 05:28

1 Answers1

1

BOM table is not usually stored as a table object.

As a first thing, I'd check the drawing background view. It is mostly stored there. Text fields are stored in the Texts collection and the table itself in the GeometricElements collection.

Try to test code below on the active sheet. There is obtained background view and sent into the message box count of the objects in both collections. If there are big numbers, your BOM table should be there.

Sub CATMain()

   Dim oDoc As Document
   Set oDoc = CATIA.ActiveDocument

   Dim oDrawDoc As DrawingDocument
   Set oDrawDoc = oDoc

   Dim oSheet As DrawingSheet
   Set oSheet = oDrawDoc.Sheets.ActiveSheet

   Dim cViews As DrawingViews
   Set cViews = oSheet.Views

   Dim oView As DrawingView

   Dim i As Integer
   For i = 1 To cViews.Count
       If cViews.Item(i).Name = "Background View" Then
           Set oView = cViews.Item(i)
    
           MsgBox "Text fields count is " & oView.Texts.Count & vbNewLine & "Geometric elements count is " & oView.GeometricElements.Count
    
       End If
   Next

End Sub

This is what you should get. Off course with different numbers

Then you can just go through Texts collection of this background view and easily obtain values from Text property of each Text object.

JMan
  • 60
  • 7
  • I already check the `Background VIew`, only 1 `GeometricElements` – N.TW12 Mar 10 '23 at 15:31
  • How about texts? What is the count of texts? It is hard to help without data. Can you forward me the catdrawing to be able to check it on my own? – JMan Mar 12 '23 at 16:16