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: 

Embedding Excel into Sheet Metal template

79 REPLIES 79
SOLVED
Reply
Message 1 of 80
Breeze104
2215 Views, 79 Replies

Embedding Excel into Sheet Metal template

First off..Noob question... How do you embed (not link) an excel spread sheet into my sheet metal template.  The excel file is simple, 2 rows listing the A1=gauge and B1= decimal equivalent.

 

What I want to do with this is to get the gauge to show up in the iProperties description along with length and width of part.  The thing is I need colum A to show up in the iProperties (12GA) but colum B to be used for the sheet metal default thicness.

 

I keep getting this errorwhen I run my code.....

 

Error in rule: Gauge, in document: Part1

GoExcel: 3rd Party worksheet not found: "3rd Party:Embedding 1", Sheet: "Sheet1"

 

Code so far..

i = GoExcel.FindRow("3rd Party:Embedding 1", "Sheet1", "Gauge", "<=", iProperties.Value("Custom", "Gauge"))

MultiValue.List("Thickness") = GoExcel.CellValues("3rd Party:Embedding 1", "Sheet1", "B2", "B35")

 

So I need help with both the embedding and code. 

79 REPLIES 79
Message 2 of 80
swordmaster
in reply to: Breeze104

Tried, to reply to your PM but having some problems with that

 

embedding the excel is not a problem

Have not looked too closely at your code yet

Came into the office this morning to a huge problem (not mine) which i have to solve, so I am a bit swamped right now. I will try to look at it later today

 

On a unrelated subject did you catch the new Doctor Who episodes?

Inventor 2010 Certified Professional
Message 3 of 80
jletcher
in reply to: Breeze104

Is there a reason for using excel? Mine are all done inside ilogic....

Message 4 of 80
Breeze104
in reply to: jletcher

well I guess since I had it I thought I would embed it into my sheet metal template.  It shows that it is embedded in the browser, but I keep getting the error I posted.

 

If there is an easier/better way I am open to ideas. 

Message 5 of 80
swordmaster
in reply to: Breeze104

I am trying to reply to your PM but i keep getting knocked back. Problem is that there are two Breeze104 id's out there. Don't know if you created both

Inventor 2010 Certified Professional
Message 6 of 80
Breeze104
in reply to: swordmaster

I got the file embedded and I got the file to be seen by iLogic.  But I am getting an error on my last line of code...

 

i = GoExcel.FindRow("3rd Party:Sheet Metal Gauge Chart .xls", "Sheet1", "Gauge", "<=", iProperties.Value("Custom", "Gauge"))

i = GoExcel.FindRow("3rd Party:Sheet Metal Gauge Chart .xls", "Sheet1", "Gauge", "<=", Gauge, "DecValue", "<=", DecValue)

MultiValue.List("Thickness") = GoExcel.CellValues("Sheet Metal Gauge Chart .xls", "Sheet1", "B2", "B35")

iProperties.Value("Project", "Description") = Gauge "x" Length "x" Width

 

 

I want the out put to show up in the description like this .....   12GA x XX x XX, but it keeps asking for "End of ststement expected"

Message 7 of 80
jletcher
in reply to: Breeze104

Change last to

 

iProperties.Value("Project", "Description") = Gauge & " x "  & Length  & " x "Width

 

Make sure to put a space between the x and the quotations.

Message 8 of 80
Breeze104
in reply to: jletcher

I knew I was forgetting something and I knew it had to be simple...I was ways seem to forget the little things... ;(

 

Thanks.

 

I keep getting an error...

 

"Error in rule: SheetGauge, in document: Sheet Metal (in).ipt

'Mild Steel Gauge Chart.xls' could not be found. Check the spelling of the file name, and verify that the file location is correct.

If you are trying to open the file from your list of most recently used files, make sure that the file has not been renamed, moved, or deleted."

 

I can't have spelled it wrong, because I copied and pasted the file name.

 

So I reworked the code…..

 

GoExcel.CellValue("3rd Party:Mild Steel Gauge Chart.xls", "Sheet1", "A1") = iProperties.Value("Custom", "Gauge")

GoExcel.CellValue("3rd Party:Mild Steel Gauge Chart.xls", "Sheet1", "B1") = iProperties.Value("Custom", "DecValue")

MultiValue.List("Gauge") = GoExcel.CellValues("Mild Steel Gauge Chart.xls", "Sheet1", "A2", "A35")

MultiValue.List("DecValue") = GoExcel.CellValues("Mild Steel Gauge Chart.xls", "Sheet1", "B2", "B35")

Thickness = DecValue

iProperties.Value("Project", "Description") = Gauge & " x "  & Length  & " x " &  Width

 

But I still get the same error…errrrrr

Message 9 of 80
jletcher
in reply to: Breeze104

So you are no longer imbedding?

 

If not I need to see the rest of the code I don't see the part where you tell it the locatiion of excel file.

Message 10 of 80
Breeze104
in reply to: Breeze104

 

 

And I have figured out that the error I am getting is coming from this section of code....

 

MultiValue.List("Gauge") = GoExcel.CellValues("Mild Steel Gauge Chart.xls", "Sheet1", "A2", "A35")

MultiValue.List("DecValue") = GoExcel.CellValues("Mild Steel Gauge Chart.xls", "Sheet1", "B2", "B35")

 

But the file name is exactly the same the section of code above it so I am not sure whay it keeps erroring out

Message 11 of 80
jletcher
in reply to: Breeze104

?

Message 12 of 80
Breeze104
in reply to: jletcher

yes I am still embedding.  I had to reverse the first 2 lines and put the iProp portion in front to keep the excel file from being written to.

 

iProperties.Value("Custom", "Gauge") = GoExcel.CellValue("3rd Party:Mild Steel Gauge Chart.xls", "Sheet1", "A1")
iProperties.Value("Custom", "DecValue") = GoExcel.CellValue("3rd Party:Mild Steel Gauge Chart.xls", "Sheet1", "B1")
'MultiValue.List("Gauge") = GoExcel.CellValues("Mild Steel Gauge Chart.xls", "Sheet1", "A2", "A35")

'MultiValue.List("DecValue") = GoExcel.CellValues("Mild Steel Gauge Chart.xls", "Sheet1", "B2", "B35")

'Parameter("Thickness") = DecValue
'Parameter("Gauge") = Gauge

iProperties.Value("Project", "Description") = Gauge & " x " & Length & " x " & Width
Message 13 of 80
Breeze104
in reply to: Breeze104

I figured out why the Muli value list were failing.... there was no "3rd Party:" in the statement.  I used the snipett so I figured it should have been right....

 

Then I got to thinking about jletcher responce and figured out what was missing.  Now I just need to figure out how to get the Gauge and DecValue to change correctly so that if I pick 12Ga then the thickness changes to .1046

Message 14 of 80
jletcher
in reply to: Breeze104

The thing is your code is not correct for embedding. Smiley Happy

 

 

It should be 3rd Party:Embedding 1

 

Your code is telling it to find a  excel file...

 

If you code is some what working it may see the excel file you made before Embedding. (un-likley)

 

To me the code will not work for embedding.

 

 

What are you sheet metal styles named?

 

To me you are still going a long way to get what you are asking.. To me all this should be done with ilogic forget about the excel file..

 

Let me see if I have a few minutes to put a sample together. Till then look into just using ilogic.

 

 

Message 15 of 80
jletcher
in reply to: Breeze104

Do me a favor take a snap shot of the browser with it expanded..

Message 16 of 80
Breeze104
in reply to: jletcher

I guess I am not sure what you mean by just using iLogic.....

 

Something like this...

 

If Gauge = 12 Then

Thickness = .1046

 

 

Message 17 of 80
jletcher
in reply to: Breeze104

Ok after looking at your Browser you are not Embedding you are linking they are not the same so this is why you are having issues.

 

Yes and no on the code for ilogic.

 

There is some set up to do.

 

Let me ask this do you have sheet metal styles set? If so give me a snap of your styles..

 

But as far as your code you have it will not work because your excel file is not Embedded Look at this pic this is embedded.

 

Embedding.JPG

 

See the difference?

 

Message 18 of 80
jletcher
in reply to: jletcher

I would give you my templete but the styles have to be the same..

Message 19 of 80
Breeze104
in reply to: jletcher

Ok then if I am not embeddeing, which I wasn't sure I was, how then...noob question comming....do you embed a file and get it to function?

 

As far as the sheet metal style set goes...since I have no idea what you are talking about Smiley Indifferent.the answer is nope...Smiley Wink

Message 20 of 80
Breeze104
in reply to: Breeze104

I figured out I needed to "Insert Object" in order to have it embedded.  See attachment for results.

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

Post to forums  

Autodesk Design & Make Report