Inventor General Discussion

Inventor General Discussion

Reply
Distinguished Contributor
Breeze104
Posts: 218
Registered: ‎01-17-2008
Message 1 of 80 (650 Views)
Accepted Solution

Embedding Excel into Sheet Metal template

650 Views, 79 Replies
09-07-2012 01:07 PM

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. 

by events ...do you mean triggers?

I can create basic rules.  I do not know VB at all so I am limited.

Distinguished Mentor
swordmaster
Posts: 541
Registered: ‎12-15-2008
Message 2 of 80 (611 Views)

Re: Embedding Excel into Sheet Metal template

09-10-2012 07:25 AM 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
*Pro
jletcher
Posts: 1,983
Registered: ‎05-18-2011
Message 3 of 80 (609 Views)

Re: Embedding Excel into Sheet Metal template

09-10-2012 07:32 AM in reply to: Breeze104

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


Please mark this response as "Accept as Solution" if it answers your question.

James Letcher
2012 Factory Design Suite ( will not load 2013)
What happen to my Inventor :-(
Distinguished Contributor
Breeze104
Posts: 218
Registered: ‎01-17-2008
Message 4 of 80 (604 Views)

Re: Embedding Excel into Sheet Metal template

09-10-2012 08:14 AM 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. 

Distinguished Mentor
swordmaster
Posts: 541
Registered: ‎12-15-2008
Message 5 of 80 (583 Views)

Re: Embedding Excel into Sheet Metal template

09-10-2012 11:21 AM 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
Distinguished Contributor
Breeze104
Posts: 218
Registered: ‎01-17-2008
Message 6 of 80 (563 Views)

Re: Embedding Excel into Sheet Metal template

09-10-2012 01:42 PM 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"

*Pro
jletcher
Posts: 1,983
Registered: ‎05-18-2011
Message 7 of 80 (552 Views)

Re: Embedding Excel into Sheet Metal template

09-11-2012 04:37 AM 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.


Please mark this response as "Accept as Solution" if it answers your question.

James Letcher
2012 Factory Design Suite ( will not load 2013)
What happen to my Inventor :-(
Distinguished Contributor
Breeze104
Posts: 218
Registered: ‎01-17-2008
Message 8 of 80 (543 Views)

Re: Embedding Excel into Sheet Metal template

09-11-2012 05:37 AM 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

*Pro
jletcher
Posts: 1,983
Registered: ‎05-18-2011
Message 9 of 80 (541 Views)

Re: Embedding Excel into Sheet Metal template

09-11-2012 05:49 AM 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.


Please mark this response as "Accept as Solution" if it answers your question.

James Letcher
2012 Factory Design Suite ( will not load 2013)
What happen to my Inventor :-(
Distinguished Contributor
Breeze104
Posts: 218
Registered: ‎01-17-2008
Message 10 of 80 (620 Views)

Re: Embedding Excel into Sheet Metal template

09-11-2012 05:55 AM 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.