Visible Rows in the PartList?

Visible Rows in the PartList?

Anonymous
Not applicable
628 Views
5 Replies
Message 1 of 6

Visible Rows in the PartList?

Anonymous
Not applicable
Is there a method through the API to determine if a row in a PartList has
been set to Invisible?

Thanks

--
Mike Thomas
IMAGINiT Technologies
0 Likes
629 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Access to the row visibility is not currently supported in the API. I've
made a note of this so we can address this in the future.

-Brian


"Mike Thomas" wrote in message
news:747CF862AB08A931CCBA83A7A1658F9C@in.WebX.maYIadrTaRb...
> Is there a method through the API to determine if a row in a PartList has
> been set to Invisible?
>
> Thanks
>
> --
> Mike Thomas
> IMAGINiT Technologies
>
>
0 Likes
Message 3 of 6

Anonymous
Not applicable
Thanks Brian.

"Brian Ekins" wrote in message
news:D2BBFE8509ADFE389EEB061BB875AA41@in.WebX.maYIadrTaRb...
> Access to the row visibility is not currently supported in the API. I've
> made a note of this so we can address this in the future.
>
> -Brian
>
>
> "Mike Thomas" wrote in message
> news:747CF862AB08A931CCBA83A7A1658F9C@in.WebX.maYIadrTaRb...
> > Is there a method through the API to determine if a row in a PartList
has
> > been set to Invisible?
> >
> > Thanks
> >
> > --
> > Mike Thomas
> > IMAGINiT Technologies
> >
> >
>
>
0 Likes
Message 4 of 6

Anonymous
Not applicable
In Inventor v11 SP2

We require an API method to determine which CustomTable rows are hidden.

This has been a problem for a long time and the work around in previous versions (9 & 10) was to use PartsLists and export them as Tab Delimited Text Files.

This technique worked because the export function does not output invisible table rows.

In version 11 we are forced to use CustomTables instead of PartsLists (for various reasons) and since CustomTables do not support the export function we are left with accessing their data via API methods. BUT! the API methods provide no way to determine which rows are set invisible so that we may ignore them.


A VB example...


Public Sub Test()

Dim oApp as Inventor.Application
Dim oDoc as Inventor.DrawingDocument
Dim oSheet as Inventor.Sheet
Dim oTable as Inventor.CustomTable
Dim oRow as Inventor.Row

Dim row_Idx as Integer


' Get access to the application, drawing, sheet and table

Set oApp = GetObject(, "Inventor.Application")
Set oDoc = oApp.ActiveDocument
Set oSheet = oDoc.Sheets(1)
Set oTable = oSheet.CustomTables(1)


' Enumerate the rows of the table

For row_Idx = 1 To oTable.Rows.Count

Set oRow = oTable.Rows(row_Idx)

' Only process a row if it is visible

If oRow.Visible Then <<<< This does not work for Tables, it only works for PartsLists!


' do something with the row, for example output it to a text file or update a database
...

EndIf


Next

End Sub


This problem has existed since at least April 2002 as can bee seen from previous posts and the AutoDesk response.

How far into the future do we need to wait for this feature?
0 Likes
Message 5 of 6

Anonymous
Not applicable
We are aware of this limitation and intend to address it in a future
release. I can't really comment on when it will be available, but this is
high on our priorities.

Sanjay-

wrote in message news:5646292@discussion.autodesk.com...
In Inventor v11 SP2

We require an API method to determine which CustomTable rows are hidden.

This has been a problem for a long time and the work around in previous
versions (9 & 10) was to use PartsLists and export them as Tab Delimited
Text Files.

This technique worked because the export function does not output invisible
table rows.

In version 11 we are forced to use CustomTables instead of PartsLists (for
various reasons) and since CustomTables do not support the export function
we are left with accessing their data via API methods. BUT! the API
methods provide no way to determine which rows are set invisible so that we
may ignore them.


A VB example...


Public Sub Test()

Dim oApp as Inventor.Application
Dim oDoc as Inventor.DrawingDocument
Dim oSheet as Inventor.Sheet
Dim oTable as Inventor.CustomTable
Dim oRow as Inventor.Row

Dim row_Idx as Integer


' Get access to the application, drawing, sheet and table

Set oApp = GetObject(, "Inventor.Application")
Set oDoc = oApp.ActiveDocument
Set oSheet = oDoc.Sheets(1)
Set oTable = oSheet.CustomTables(1)


' Enumerate the rows of the table

For row_Idx = 1 To oTable.Rows.Count

Set oRow = oTable.Rows(row_Idx)

' Only process a row if it is visible

If oRow.Visible Then <<<< This does not work for Tables, it only
works for PartsLists!


' do something with the row, for example output it to a text file
or update a database
...

EndIf


Next

End Sub


This problem has existed since at least April 2002 as can bee seen from
previous posts and the AutoDesk response.

How far into the future do we need to wait for this feature?
0 Likes
Message 6 of 6

rschader
Advocate
Advocate

The future has arrived! The following macro renumbers the custom table row 1 ignoring the invisible rows:

 

Public Sub RenumberCustomTable()

    Dim oTable As Inventor.CustomTable
    Dim oRow As Inventor.row
    Dim row_Idx As Integer
    Dim VisibleRowNumber As Integer

    Set oTable = ThisApplication.CommandManager.Pick(kDrawingCustomTableFilter, "Pick Table to Renumber")
    VisibleRowNumber = 1

    ' Enumerate the rows of the table
    For row_Idx = 1 To oTable.Rows.Count
        Set oRow = oTable.Rows(row_Idx)
        ' Only process a row if it is visible
        If oRow.Visible Then '<<<< This does not work for Tables, it only works for PartsLists!
            oRow.Item(1).Value = VisibleRowNumber
            VisibleRowNumber = VisibleRowNumber + 1
        End If
    Next
End Sub
0 Likes