Link excel cells to Inventor Drawing Text

Link excel cells to Inventor Drawing Text

Jesper_S
Collaborator Collaborator
1,253 Views
4 Replies
Message 1 of 5

Link excel cells to Inventor Drawing Text

Jesper_S
Collaborator
Collaborator

Hi.

 

Have been searching for a solution but not found one.

Is there a way to link a specific cell in an excel spreadsheet to a Text in an Inventor Drawing using iLogic?

 

I have on my Drawing some Textfields that i want to drive from an excel spreadsheet.

Text.JPG    Text excel.JPG

Textfields on my Drawing.                                       Excel Spreadsheet.

 

I want the Value from column B to be inserted into the drawing Textfields.

 

Found this from Curtis W, and its something like this im after.

http://inventortrenches.blogspot.se/2014/06/ilogic-titleblock-project-data-from.html

 

Using Inventor 2015

 

//Jesper

 


//Jesper

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
0 Likes
Accepted solutions (1)
1,254 Views
4 Replies
Replies (4)
Message 2 of 5

MechMachineMan
Advisor
Advisor

I believe the only way is like how Curtis accomplished it; have an iLogic routine that pushes values into prompted entry textboxes.


--------------------------------------
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
Message 3 of 5

Owner2229
Advisor
Advisor

Hi, why does it need to be linked to Excel? Are you using this Excel table for something else or do you want to use it for more than one drawing?

My point is, that you can have these textfields in your template and fill them with a form. I have button added to ribbon so it is easy to use.

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 4 of 5

Jesper_S
Collaborator
Collaborator

Hi.

 

My customer want to use Excel. They link it to another application also so i kind of have to use Excel.

There is no way to link the cells to a Custom iProperty in the drawing? Then i can link the Textfield to that property.

 

I started to use a form but my customer said no. Smiley Sad


//Jesper

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
0 Likes
Message 5 of 5

Owner2229
Advisor
Advisor
Accepted solution

Hi, you have to think witch trigger to use for it (new document, before save etc.), but I think that you can use one of these rules below (you have to modify it for your needs ofc.).

If you already have the iProperties in place than you can use this:

 

GoExcel.Open("C:\myfolder\myexceltable.xlsx", "Sheet1")
iProperties.Value("Custom", "Text 1") = GoExcel.CellValue("B2")
iProperties.Value("Custom", "Text 2") = GoExcel.CellValue("B3")
...
GoExcel.Close


If you want the iProperty names to be taken from the excel table than you can use this one:

 

GoExcel.Open("C:\myfolder\myexceltable.xlsx", "Sheet1")
Dim oName As String = GoExcel.CellValue("A2")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B2")
oName = GoExcel.CellValue("A3")
iProperties.Value("Custom", oName) = GoExcel.CellValue("B3")
...
GoExcel.Close

 

Or if you have a lot of text cells than you can use this one to automate the procces. It will find all filled cells in all rows up to infinity.

 

 

GoExcel.Open("C:\myfolder\myexceltable.xlsx", "Sheet1")
RowStart = 2
RowEnd = 100 For countA = RowStart To (RowEnd * 0.01) + RowStart If Not String.IsNullOrEmpty(GoExcel.CellValue("A" & RowEnd)) Then RowEnd = RowEnd + 100 Else Exit For End If Next For rowPN = RowStart To RowEnd If String.IsNullOrEmpty(GoExcel.CellValue("A" & RowPN)) Then rowN = rowPN - 1 Exit For End If Next For oRow = RowStart To RowN
Dim oName As String = GoExcel.CellValue("A" & oRow)
iProperties.Value("Custom", oName) = GoExcel.CellValue("B" & oRow)
Next
GoExcel.Close

 

 Just remember, that the last rule will stop on first empty row it will find.

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods