I have spent hours searching the forums for a way to use iLogic to create custom iProperties from the cells in an Excel spreadsheet (both text and numbers) for a .dwg template. The only thing even close has been a user who already knew how to do it and was having a different problem. I am using Inventor 2012 and Excel 2003 and have very little experience with VB. I currently have a family of assemblies, consisting of two parts linked to an Excel spreadsheet to control the various parameters for each variation of the assembly.
I need some help creating an iLogic rule that will:
Go to a specific tab (I have four different tabs/worksheets) in an Excel spreadsheet.
Make a specfic row of that worksheet the current row based on the part number used to generate the models of the assembly shown in a .dwg.
Use the contents of a cell in that row (text or numeric or a combination of both) to generate a custom iProperty for the .dwg template.
Use the custom iProperties to fill in the title block of the template.
Any help using the specifics of the spreadsheet attached in an example of iLogic will be greatly appreciated.
I believe i was able to accomplish this in a .ipt , hsve not as yet tried with a .idw
I embedded your workbook into the part and used the following ilogic code, i hope it help in a small way
= GoExcel.FindRow("3rd Party:Embedding 1", "123", "part_number", "=",iProperties.Value("Project", "Part Number"))
("Custom", "eric_custom") = GoExcel.CurrentRowValue("oal")
Thank you for a prompt reply, Swordmaster. I will attempt this code as soon as I can and let you know how it works. Is embedding the same as linking the spreadsheet to the model / assembly?
I have been working with Inventor for just over a year and found many helpful tips and other code to use, but it is frustrating when I can only work with the program for 2 to 6 hours per week at most...some weeks not at all.
Apologies for the late reply, I have been hiding from Hurricane Isaac
Linked and Embedded are a little different
For values that will change (user selection) i use a linked workbook
For values which are constant (look up values) i use a embedded workbook
Linked workbooks are normally stored in the same folder as the model
Embedded workbooks are as the word implies "embedded" in the Inventor model and the workbook does not reside in any folder.
When using a embedded workbook it is possible to access different worksheets using ilogic
When using a Linked workbook only the first worksheet(sheet 1) can be accessed
Thanks again Swordmaster~! Sorry it took so long to reply. I think your explanation of the difference between linked and embedded workbooks helped clarify one of my issues. It would appear I am not going to be able to make the assembly variations as easy to generate as I had hoped.
WIth respect to the iLogic I wanted to populate fields in an .idw, I have finally stumbled on the solution in the Wiki help files. I don't know why it took me so long and, as always, the solution is so simple it boggles my mind that I didn't find it sooner. I only needed to write a rule which would generate the custom iProperties in the .aim of the first view listed in the browser tree of the drawing. Then I was able to edit the definition of the drawing and use those custom iProperties to populate the title block.
Access a broad range of knowledge to help get the most out of your products and services.