Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

nx journal: PartsList and TableSection

Status
Not open for further replies.

MANox

Mechanical
Apr 2, 2007
121
Hello EveryOne,

I need information about PartsLists in my workpart - which one have enable AutomaticUpdate (and which have dissable).
For table it's easy - p.ex.:
Code:
        For Each section As Annotations.TableSection In workPart.Annotations.TableSections
            Dim objects1(0) As NXOpen.DisplayableObject
            objects1(0) = section
            Dim tableEditSettingsBuilder1 As NXOpen.Annotations.TableEditSettingsBuilder = Nothing
            Try
                tableEditSettingsBuilder1 = workPart.SettingsManager.CreateTableEditSettingsBuilder(objects1)
                tableEditSettingsBuilder1.TableSection.ApplyToAllSections = True
                lw.WriteFullline(section.Tag & "    " & tableEditSettingsBuilder1.PartsList.AutomaticUpdate)
                Dim nXObject1 As NXOpen.NXObject = Nothing
                nXObject1 = tableEditSettingsBuilder1.Commit()
                tableEditSettingsBuilder1.Destroy()
            Catch
            End Try
        Next

Teoretical, Partslist is kind of Table, and when I record journal for change AutomaticUpdate program select it's automaticly like TableSection.
But when I try select all partslists programicaly, I can't select section of them.

Maybe sombody can help with this?
(it's not nessesery for me, but a little useful).

Best regards

MANok
NX2027
TC14




 
Replies continue below

Recommended for you

Thank cowski for help.


I insert part of code for checking automatic update status of all partslists, and writing its to dictionary, and changing to FALSE.
Code:
      Dim tableStatusDictionary As New Dictionary(Of Annotations.TableSection, Boolean)

        Dim pListTags() As Tag = Nothing
        Dim numPartsLists As Integer
        Dim partListTable As New List(Of Annotations.Table)
        ufs.Plist.AskTags(pListTags, numPartsLists)

        For Each tempTag As Tag In pListTags
            Dim myPlist As Annotations.Table = Utilities.NXObjectManager.Get(tempTag)
            If myPlist.Layer = 0 Then
                Continue For
            Else
                partListTable.Add(myPlist)
            End If
        Next


        For Each table1 As Annotations.Table In partListTable
            For Each tabSection As Annotations.TableSection In workPart.Annotations.TableSections
                Dim tempTableTag As Tag
                ufs.Tabnot.AskTabularNoteOfSection(tabSection.Tag, tempTableTag)
                If tempTableTag = table1.Tag Then
                    Dim objects1(0) As NXOpen.DisplayableObject
                    objects1(0) = tabSection
                    Dim tableEditSettingsBuilder1 As NXOpen.Annotations.TableEditSettingsBuilder = Nothing
                    tableEditSettingsBuilder1 = workPart.SettingsManager.CreateTableEditSettingsBuilder(objects1)
                    tableStatusDictionary.Add(tabSection, tableEditSettingsBuilder1.PartsList.AutomaticUpdate)
                    tableEditSettingsBuilder1.PartsList.AutomaticUpdate = False
                    Dim nXObject1 As NXOpen.NXObject = Nothing
                    nXObject1 = tableEditSettingsBuilder1.Commit()
                    tableEditSettingsBuilder1.Destroy()
                End If
            Next
        Next

and back to start status after end work with partslists:
Code:
        For Each tableSection1 As Annotations.TableSection In tableStatusDictionary.Keys

            Dim objects1(0) As NXOpen.DisplayableObject
            objects1(0) = tableSection1
            Dim tableEditSettingsBuilder1 As NXOpen.Annotations.TableEditSettingsBuilder = Nothing
            tableEditSettingsBuilder1 = workPart.SettingsManager.CreateTableEditSettingsBuilder(objects1)
            tableEditSettingsBuilder1.TableSection.ApplyToAllSections = True
            tableEditSettingsBuilder1.PartsList.AutomaticUpdate = tableStatusDictionary.Item(tableSection1)
            Dim nXObject1 As NXOpen.NXObject = Nothing
            nXObject1 = tableEditSettingsBuilder1.Commit()
            tableEditSettingsBuilder1.Destroy()
        Next

Maybe it's be useful for someone.
Or someone write its better.

Best regards

MANok
NX2027
TC14
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor