excel drawing register - ilogic

excel drawing register - ilogic

Anonymous
Not applicable
594 Views
1 Reply
Message 1 of 2

excel drawing register - ilogic

Anonymous
Not applicable

Merry Christmas all 🙂

 

I have an excel drawing register. Within that register we record progress tracking. ie 10%, 50%, 100% etc..

At the moment, we simply have one row for each drawing number.

Everytime there is a revision, the row in excel is overwritten with the new details of the revision and the progress tracking begins again.

All done at the moment via ilogic.

 

The point is we lose history. Something I would very much like to retain.

 

 

I would like that, when a drawing is open an we are ready to write to the register that the following happens.

 

ilogic checks to see if the drawing number exists in the register,

 

If so it checks to see if the 100% complete 'cell' has a release date... If the cell contains nothing, then it can continue as planned. and populate the cells as desired on that row

 

If a date exists in the 100% complete cell, then the drawing number is released and the code should then create a new row directly underneath the fore mentioned row and the code would then populate that row at the current revision.

 

Has anyone done any coding similar to below that they could kindly share...

 

many thanks in advance as always.

 

 

 

0 Likes
595 Views
1 Reply
Reply (1)
Message 2 of 2

MechMachineMan
Advisor
Advisor

You gonna need some excel vba of you haven't directly connected to that yet. ExL

 

   ' Open Excel.
    Set oExcel = CreateObject("Excel.Application")
    
    ' Open the OLE Excel file.
    Dim oWorkbook As Excel.Workbook
    On Error Resume Next
    
    ' Use existing spreadsheet
     Set oWorkbook = oExcel.Workbooks.Open(FullFileName)

    ' Identify and name the sheet
    Dim oWorkSheet As WorkSheet
    Set oWorkSheet = oWorkbook.Sheets.Item(1)
    
    ' Find first empty row in worksheet
    Dim q As Integer
    q = oWorkSheet.Range("A1").End(xlDown).Row
 
    ' Iterate through the rows of the parts list.
    Dim rowIndex As Integer
    rowIndex = 1
    Dim partListRow As PartsListRow
    For Each partListRow In partList.PartsListRows
        rowIndex = rowIndex + 1

        ' Select the first cell of the current row in the table.
        Set myrange = partListTable.Cell(rowIndex, 1).Range
        myrange.End = partListTable.Cell(rowIndex, 1).Range.End
        myrange.Select
    
        ' Copy the rest of the part list info into the table for this row.
        Dim i As Integer
        For i = 1 To partList.PartsListColumns.Count
            Set myrange = partListTable.Cell(rowIndex, i + 1).Range
            myrange.End = partListTable.Cell(rowIndex, i + 1).Range.End
            myrange.Select
            
            Dim j As Integer
            For j = 1 To partList.PartsListRows.Count
                oWorkSheet.Cells(j + q, i).Value = partList.PartsListRows(j).Item(i).Value
            Next
        Next

	oWorkSheet.Cells(partList.PartsListRows.Count + q, partList.PartsListColumns.Count + 1).Value = frameNo
 	oWorkSheet.Cells(partList.PartsListRows.Count + q, partList.PartsListColumns.Count + 2).Value = frameQty

    Next 

 

Something like the above.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes