Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic and Excel Spreadsheets, linking Values help

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
3638 Views, 6 Replies

iLogic and Excel Spreadsheets, linking Values help

Ok what I'm tring to do is have a spreadsheet that has a list of prices in it that we could modifiy if needed for all these parts im making.  Best way is to have the spreadsheet obviously external of the file.

 

Though now I do not know how to do this in iLogic.

 

And example of what I'm trying to do is, with 3 parameters.

 

A, B, and P

 

Value "A" and Value "B", these are just read items which when combined will give Value "P" to be imported into the Part file.  So need A & B to be read and give the row number for P to be imported.

6 REPLIES 6
Message 2 of 7
Curtis_Waguespack
in reply to: Anonymous

Hi

 

Would it make more sense to do the costing in Excel rather than bring the prices into Inventor? If so this link might be of interest:

http://inventortrenches.blogspot.com/2011/06/ilogic-export-parts-list-with-options.html

 

If you determine that it is best to bring the prices into Inventor, I'm sure that could be done as well. You might attach some example files.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

 

Message 3 of 7
Yijiang.Cai
in reply to: Anonymous

This could be accomplished by iLogic, and please see the steps below -

1. Create one excel spreadsheet like below

==================

A  B  P

1  2  4

2  5  8

===================

 

2. Add three user parameters in parameters table like "a", "b", "p"

3. Link the excel spread sheet in parameters table with "embed" option

4. Create one iLogic rule using the code below -

 

p1=Parameter("a")

p2=Parameter("b")

 

i = GoExcel.FindRow("3rd Party:Embedding 1", "Sheet1", "a", "=", p1, "b", "=", P2)

 

If i>0 Then

    p=GoExcel.CellValue("3rd Party:Embedding 1", "Sheet1", "C" & CStr(i))

    iLogicVb.UpdateWhenDone = True

End If

 

Runing the rule. When the a and b value change, the right p value will be achieved.

 

Thanks,

River

 

 

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com
Message 4 of 7
Anonymous
in reply to: Yijiang.Cai

Thanks guys, actually was able to solve it on my own using  a little different code.

 

'Searches for ID and Brings In Data for Part Name
i = GoExcel.FindRow("D:\Vault\Pricing.xlsx", "Bottle Straight MT", "ID", "<=", ID)
iProperties.Value("Project", "Part Number") = GoExcel.CurrentRowValue("PartName")

i = GoExcel.FindRow("D:\Vault\Pricing.xlsx", "Bottle Straight MT", "ID", "<=", ID)
iProperties.Value("Project", "Estimated Cost") = GoExcel.CurrentRowValue("Price")
iLogicVb.UpdateWhenDone = True
Message 5 of 7
Anonymous
in reply to: Anonymous

deathman20, can you show me how it works your spreadsheet with the inventor part?

I'm having trouble in adapting your code.

Message 6 of 7
Anonymous
in reply to: Anonymous

Hello Plouro.  Sadly I can't help with the original code/process that I used to make it work.

The project was abandoned and have since moved on to other things and been out of doing this type of coding for quiet some time.

 

River Cai explains it nicely.  I think I addapted what was done with a little bit of a different process to make it functionable for me.

Try using the part that was provided above for help with it and seeing the code.

 

What I do is design layouts for various types of facilities that uses different pieces of conveyors for transportation of materials/goods from one machine to another. The end goal was to being able to do the layout and price it exactly at the same time.  Thus cutting down on time to do pricing on the side.

So the part information I had was part "X" wide and "Y" long.  With that it had a set value pricing between a range for the various widths and lengths.  Since it was about 100 parts in one file that I wanted to update potentially on the fly without editing the base inventor file again I needed to read from which was mentioned an excel spreed sheet.  So I wanted to every time the size changed, to read the excel file and from the 2 parameters I knew to go and read the line item in execl and place back into the properites of said file, which I could use for a cost in the material list on the overall drawing.

Message 7 of 7
russell.cantos
in reply to: Anonymous

Amazing! It worked for me.

 

the ilogic code:

iProperties.Value("Project", "Estimated Cost") = GoExcel.CellValue("\\SRV-DOC\location of excel file on server\name_of_excel_file.xlsx", "sheet name", "cell")
iLogicVb.UpdateWhenDone = True

The above example takes a dollar value from my excel sheet and updates the iproperties "Estimated Cost" returning it with a dollar value.

 

THANK YOU forum

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report