iLogic to create general table from excel file

iLogic to create general table from excel file

dutt.thakar
Collaborator Collaborator
806 Views
3 Replies
Message 1 of 4

iLogic to create general table from excel file

dutt.thakar
Collaborator
Collaborator

Hello,

 

I am trying to create a custom table in Inventor drawing using iLogic. I have got one code by which I am able to copy the first worksheet data from excel file. The code is shown below.

 

Dim oDrawDoc As DrawingDocument
  oDrawDoc = ThisApplication.ActiveDocument
    
    
     Dim oActiveSheet As Sheet
      oActiveSheet = oDrawDoc.ActiveSheet
    
    
      Dim oPoint As Point2d
      oPoint = ThisApplication.TransientGeometry.CreatePoint2d(25, 20)
    

     Dim oExcelTable As CustomTable
oExcelTable = oActiveSheet.CustomTables.AddExcelTable("Trial.xlsx",oPoint,"Trial")

 

Is there any way I can copy data from different worksheets and create tables using iLogic from  one excel file?

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
807 Views
3 Replies
Replies (3)
Message 2 of 4

Mark.Lancaster
Consultant
Consultant

@dutt.thakar

 

iLogic questions, concerns, and issues should be posted in the Inventor Customization forum for best results.  I will have the moderator relocate your posting there to better suit your needs.

 

https://forums.autodesk.com/t5/inventor-customization/bd-p/120

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 3 of 4

dutt.thakar
Collaborator
Collaborator

Thanks @Mark.Lancaster for your co operation

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 4 of 4

JamieVJohnson2
Collaborator
Collaborator

Yes.  Create a table similar to the way I created this 'weld requirements table' we use everyday.  Change the title, headers, and contents to your necessary data.  Notice it uses an array of data that keeps going row after row, make sure to get the number of columns right.  BTW this is using VB.Net code but it should be easily used in iLogic.

    Public Function CreateWeldCalcsTable(ByRef sht As Inventor.Sheet, Optional strContents() As String = Nothing, Optional strTitle As String = Nothing) As Inventor.CustomTable
        Try
            Dim pntTable As Point2d = tg.CreatePoint2d(29.65 * 2.54, 8 * 2.54)
            If strTitle = Nothing Then strTitle = "WELD SECUREMENT CALCULATIONS (XXX,XXX LBS)"
            Dim strHeaders() As String = {"DIRECTION", "REQUIRED", "CALCULATED"}
            If strContents Is Nothing Then strContents = {"LONGITUDINAL", "R# KIPS", "C# KIPS", "LATERAL", "R# KIPS", "C# KIPS", "VERTICAL", "R# KIPS", "C# KIPS"}
            Dim dblColumnWidths() As Double = {1.5 * 2.54, 1.5 * 2.54, 1.5 * 2.54}
            Return sht.CustomTables.Add(strTitle, pntTable, 3, 3, strHeaders, strContents, dblColumnWidths)
        Catch ex As Exception
            Dim eh As New ErrorHandler(ex)
            eh.HandleIt()
        End Try
        Return Nothing
    End Function
Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes