Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Fetch all tableSections from a Drawing

Hello all,

 

How can i get an array of all tableSection objects in a Drawing, any help would be appreciated.

 

 

4 REPLIES

Re: Fetch all tableSections from a Drawing

Part objects have a .TableSections collection (NX 8 or above) that you can use to access all the table sections. The table section collection is a member of the annotations collection, so accessing it would look like this:

 

{part object reference}.Annotations.TableSections

Re: Fetch all tableSections from a Drawing

i have tried this

TableSection[] tableArray = theSession.Parts.Work.Annotations.TableSections.ToArray();

 

but the array always return NULL

Re: Fetch all tableSections from a Drawing

[ Edited ]

What version of NX?

It seems to work for me in 9.0.3.4, but returns zero in NX 8.5.3.3. Perhaps it is a bug in older versions of NX?

 

If the table section collection doesn't work for you, you can use the CycleObjsInPart function to get the table sections. Refer to the GTAC code:

http://solutions.industrysoftware.automation.siemens.com/view.php?si=nx_api4933

Solution
Solution
Accepted by topic author AhmedAllam
‎02-05-2016 10:01 AM

Re: Fetch all tableSections from a Drawing

Ya, you can use cyclebyObjsInPart() ...

 

 Do
            ufs.Obj.CycleObjsInPart(dp.Tag, _
                UFConstants.UF_tabular_note_type, tableSection)
            If tableSection = NXOpen.Tag.Null Then
                Continue Do
            End If
            ufs.Obj.AskTypeAndSubtype(tableSection, t, st)
            If st = UFConstants.UF_tabular_note_section_subtype Then
                Echo("Found a section: " & tableSection.ToString())
                Dim isOn As String = Nothing
                Dim status As Integer = 0
                ufs.View.AskViewDependentStatus(tableSection, status, isOn)
                If status = 1 Then
                    Echo("   It resides on: " + isOn.Split("@")(0))
                End If
            End If
        Loop Until tableSection = NXOpen.Tag.Null