ilogic configuration problem in inventor 2016?

ilogic configuration problem in inventor 2016?

Anonymous
Not applicable
1,599 Views
26 Replies
Message 1 of 27

ilogic configuration problem in inventor 2016?

Anonymous
Not applicable

hi!

 

we have just installed inventor 2016 but the rule who created my partist dont work now, but work great in inventor 2015, the problem is do not keep the vb macro in my excel sheet???

 

Thanks for your help!

 

 

 

 

0 Likes
1,600 Views
26 Replies
Replies (26)
Message 21 of 27

Anonymous
Not applicable

i change the iColStart to 10 for col "t" in excell and exportto col "A"?

0 Likes
Message 22 of 27

Anonymous
Not applicable

ok work really great thanks again Adam 🙂

0 Likes
Message 23 of 27

Anonymous
Not applicable

Again a quetion!

 

I have a little problem, all invisible row in the partlist is exported, it's possible to dont exported the invisible row???

0 Likes
Message 24 of 27

Anonymous
Not applicable

Again a question!

 

I have a little problem, all invisible row in the partlist is exported, it's possible to dont exported the invisible row???

0 Likes
Message 25 of 27

Anonymous
Not applicable

Hi Adam

 

Again a question!

 

I have a little problem, all the invisible row in the partlist is exported, it's possible to dont export the invisible row???

0 Likes
Message 26 of 27

adam.nagy
Autodesk Support
Autodesk Support

Hi Serge, 

 

The forum was down when I tried to answer.

 

You just have to investigate the properties of the objects you are dealing with:

http://adndevblog.typepad.com/manufacturing/2013/10/discover-object-model.html

 

E.g. in this case check the PartsListRow object: it has a Visible property which I think is exactly for that. 

 

See modified code with the difference highlighted in red:

Sub ExportPartsListContent()
  Dim oExcel As Object
  Set oExcel = CreateObject("Excel.Application")
  
  ' For debugging
  'oExcel.Visible = True
    
  Dim oWB As Object
  Set oWB = oExcel.Workbooks.Open("C:\temp\test.xlsm")
  
  Dim oWS As Object
  Set oWS = oWB.ActiveSheet
  
  Dim oDoc As DrawingDocument
  Set oDoc = ThisApplication.ActiveDocument
  
  Dim oSheet As Sheet
  Set oSheet = oDoc.ActiveSheet
  
  ' Export the first PartsList
  Dim oPL As PartsList
  Set oPL = oSheet.PartsLists(1)
  
  ' Starting cell position on the Excel sheet
  Dim iRowStart As Integer: iRowStart = 1
  Dim iColStart As Integer: iColStart = 1
  
  ' Export headers
  Dim iRow As Integer: iRow = iRowStart
  Dim iCol As Integer: iCol = iColStart
  Dim oCol As PartsListColumn
  For Each oCol In oPL.PartsListColumns
    oWS.Cells(iRow, iCol).Value = oCol.Title
    iCol = iCol + 1
  Next
  iRow = iRow + 1
  
  ' Export content
  Dim oRow As PartsListRow
  For Each oRow In oPL.PartsListRows
    If oRow.Visible Then
      iCol = iColStart
      Dim oCell As PartsListCell
      For Each oCell In oRow
        oWS.Cells(iRow, iCol).Value = oCell.Value
        iCol = iCol + 1
      Next
      iRow = iRow + 1
    End If
  Next
  
  ' Save it
  ' We disable the confirmation dialog
  ' in case the file already exists and
  ' needs to be overwritten
  oExcel.DisplayAlerts = False
  Call oWB.SaveAs("C:\temp\test2.xlsm")
  
  ' Close excel
  Call oExcel.Quit
End Sub

Cheers,

 



Adam Nagy
Autodesk Platform Services
Message 27 of 27

Anonymous
Not applicable

i imagine that 😉

 

thank you very much again Adam 🙂

 

 

 

 

0 Likes