Making a link between an excel table and a drawing list table

Making a link between an excel table and a drawing list table

airmylest
Contributor Contributor
466 Views
6 Replies
Message 1 of 7

Making a link between an excel table and a drawing list table

airmylest
Contributor
Contributor

Capture1.PNGOn the main page of drawings I need to put a list of all the drawings in the package. Sometimes there are 50 individual drawings in the package and making a list of all the drawing numbers can be time consuming. At the same time, I have a list of all the drawings in an Excel file to keep track of the revisions. 

 

Is there a way to formulate a list of all the "Sheets"(or drawing numbers) automatically while simultaneously updating the Excel table?

 

I've noticed that you can import an Excel table into Inventor and any modifications in Excel will update the table in Inventor, but is it possible to update the Excel table automatically when a change was made to the table in Inventor?

0 Likes
467 Views
6 Replies
Replies (6)
Message 2 of 7

A.Acheson
Mentor
Mentor

I believe there is a setting  where you open the excel and modify directly. TBH you have such a large table set it would be much more beneficial to learn how to add these details by code. I see maybe >50 entries which is time consuming. Assuming these come from an object source like sheet name and or view name you will be automatically able to extract this info in a few seconds once you have created the code. If you want assistance with that just identify the source of the info and I or others can point you in the right direction. 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 7

johnsonshiue
Community Manager
Community Manager

Hi! I think this will require an iLogic rule. Let me move this discussion to Inventor Programming forum.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 4 of 7

airmylest
Contributor
Contributor

Hello,

 

For the drawing list on Inventor, I would like to have the Drawing No. and the Description like in the original picture. The drawing number will be the Sheet name. As for the description, it can be found under (Sheet)->(Our Title Block)->Field Text->Edit Field Text->(<Title>), also defined as a prompted entry.

 

For the excel list I would like to have the Drawing Number, Revision Number, Date of Latest Revision, Description. For the drawing number, it is the Sheet name. For the revision number its (Sheet)->(Our Title Block)->Revision History->Edit->REV. To get to Date of Latest Revision, its (Sheet)->(Our Title Block)->Revision History->Edit->Date. For description, its (Sheet)->(Our Title Block)->Field Text->Edit Field Text->(<Title>), also defined as a prompted entry.

 

Please see the attached sample title block.

 

Thank you for the help.

0 Likes
Message 5 of 7

A.Acheson
Mentor
Mentor

Hi @airmylest 

Here is a post that has a good start. It was designed to copy prompted entry from one sheet to another but you can rework it to wait you need. 

Here is the portion you need slightly Condensed. You will need to supply the prompted entry name display name in place of "MY_PROMPT". If the display name is correct the value will be displayed in the logger. 

 

' assume sheet1 and sheet use the same title block definition
    
    Dim doc = ThisApplication.ActiveDocument
    
    'get first sheet
    Dim sht= doc.Sheets(1)
    
    'get titleblock of sheet1
    Dim tb = sht.TitleBlock
    
    ' search the textbox in definition 
    Dim oPromptText  
    Dim eachText 
    For i As Integer = 1 To tb.Definition.Sketch.TextBoxes.Count
          eachText = tb.Definition.Sketch.TextBoxes(i)
        If (eachText.Text = "MY_PROMPT") Then
            ' found the prompt text we want to copy
              
         'get the result string of the prompt text
          Dim promptEntry As String = oTB1.GetResultText(eachText)
            Logger.info(promptEntry)
        End If
    Next i
    
    

Once you have one you can then add additional If statements to get more. Getting into excel will have other steps. Because you have multiple requests it is better to split it into to more manageable sections to understand what's happening. You can then do searches on this forum and find posts to help with other steps such as 

>Get sheetname

>Get drawing iproperties.

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 6 of 7

airmylest
Contributor
Contributor
Hello, I was just wondering where you would've moved the discussion to on the Inventor Programming forum so I could check and see if anyone answered.
0 Likes
Message 7 of 7

A.Acheson
Mentor
Mentor

You have replied to the post in the ilogic forum. Did you see my response above? Please test and see can you get it to work for your situation. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes