Inventor General Discussion

Inventor General Discussion

Reply
Distinguished Contributor
zdhrichard
Posts: 128
Registered: ‎05-03-2011
Message 1 of 7 (600 Views)

Need help to use embedding spreadsheet in iLogic

600 Views, 6 Replies
01-21-2014 12:18 PM

For some reason, I want to use embeded excel sheet in part, and I will use ilogic rule to control my block (Size, and lot of other parameters).

But when I run the rule, it give me following error.

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

 

Could somebody please tell me what mistake I made? Please see atatched model.

Rich

Autodesk Inventor Professional 2014 (64 Bit Edition)
Build: 246, Release 2014 SP2 Update 2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
Distinguished Mentor
pcrawley
Posts: 703
Registered: ‎05-23-2002
Message 2 of 7 (586 Views)

Re: Need help to use embedding spreadsheet in iLogic

01-21-2014 01:37 PM in reply to: zdhrichard

It's the "CodeTable" bit in 3rd Party: CodeTable",Sheet:"Sheet1

 

Change it back to Embedding

 

The rest of the syntax looks a bit suspect too...

 

Try:  GoExcel.CellValue("3rd Party:Embedding 1", "Sheet1", "A2")

 

So your code should read:

 

         x = GoExcel.CellValue("3rd Party:Embedding 1", "Sheet1", "A2") 'To read from the sheet

 

Or 

 

         GoExcel.CellValue("3rd Party:Embedding 1", "Sheet1", "A2") = x 'To write to the sheet

 

Where the only bits you should change are "Sheet1" which is the sheet name in the embedded file, and "A2" is the cell for the data you are reading/writing.

 

I've noticed that regardless of the name of the original spreadsheet - or the name you give it in the Inventor Browser - iLogic always refers to it as "Embedding1".  If you delete the embedded sheet and embed a new one, it becomes "Embedding2".

 

EDIT:  I just realise you posted the error message - not the code.  That's why I thought the syntax was wrong.  My mistake - sorry.

 

Peter
Distinguished Contributor
zdhrichard
Posts: 128
Registered: ‎05-03-2011
Message 3 of 7 (576 Views)

Re: Need help to use embedding spreadsheet in iLogic

01-21-2014 01:56 PM in reply to: pcrawley

Thanks lot for your reply, Peter.

Unfortunately, even I make a brand new one and put the code as you wrote, it still give me the error.

 

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

 

And what I need to do is:

If my "FlangePortCode" is changed as from "1L" to "2M", I need my block size to be changed at same time.

I have almost more than 20 parameters need to be change for each "FlangePortCode" change in my actual model.

 

Any other advise to make it work?

Rich

Autodesk Inventor Professional 2014 (64 Bit Edition)
Build: 246, Release 2014 SP2 Update 2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
Distinguished Mentor
pcrawley
Posts: 703
Registered: ‎05-23-2002
Message 4 of 7 (568 Views)

Re: Need help to use embedding spreadsheet in iLogic

01-21-2014 03:19 PM in reply to: zdhrichard

Try this.  Open the attached part file, expand the 3rd Party folder in the browser, right-click and edit the spreadsheet (Embedding1).

 

If you edit the rule and have a look at the code, it shoud say:

    'This writes a value to the spreadsheet cell A2
   GoExcel.CellValue("3rd Party:Embedding 1", "Sheet1", "A2") = "This came from Inventor!"

   'This reads a value from the spreadsheet cell C4
   valueFromExcel = GoExcel.CellValue("3rd Party:Embedding 1", "Sheet1", "C4")

   'This displays whatever was in C4 in a messagebox
   MessageBox.Show(valueFromExcel, "iLogic")

 

Make sure you have the spreadsheet open and visible - then run the code.  You should see some text appear in cell A2, and a message box appear in Inventor.

 

Hope this helps.

Peter
Distinguished Contributor
zdhrichard
Posts: 128
Registered: ‎05-03-2011
Message 5 of 7 (557 Views)

Re: Need help to use embedding spreadsheet in iLogic

01-22-2014 06:25 AM in reply to: pcrawley

Thanks.

Your ExcelTest.ipt is working in my computer even I added "GoExcel.FindRow", but "GoExcel.CurrentRowValue" does not work which comes from a tutorial file. I could use "GoExcel.CellValue" to solve this issue.

 

But the problem is: I need create a new *.ipt file. No matter how I insert the excel object (Create New or Creat from File, and I tries all type format as following, it gave me some error message:

 

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

 

Please see attached MyTest.ipt

 

Capture.PNG

 

My Excel software is Part of Microsoft Office Home and Business 2010, Version: 14.0.7106.5003 (64 bit).

 

Any ideas to solve this issue in order I could create my *.ipt file?

Rich

Autodesk Inventor Professional 2014 (64 Bit Edition)
Build: 246, Release 2014 SP2 Update 2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
Distinguished Contributor
zdhrichard
Posts: 128
Registered: ‎05-03-2011
Message 6 of 7 (545 Views)

Re: Need help to use embedding spreadsheet in iLogic

01-22-2014 08:17 AM in reply to: pcrawley

And Peter,

I noticed you discussed with somebody on 09-03-2013 for using excel. You recommended

GoExcel.FIndRow

and

GoExcel.CurrentRowValue

Do you know what the reason is I cannot use "GoExcel.CurrentRowValue" function? Even I put it inot your *.ipt file, it does not work.

 

And I still need to find out what is the reason after I inserted Excel spreadsheet into my *.ipt, the function cannot find the sheet issue as I mentioned in my previous post.

 

I am sorry, I cannot atatched my files because restriction of our server. I will try to put it from home this evening.

Rich

Autodesk Inventor Professional 2014 (64 Bit Edition)
Build: 246, Release 2014 SP2 Update 2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
Distinguished Contributor
zdhrichard
Posts: 128
Registered: ‎05-03-2011
Message 7 of 7 (519 Views)

Re: Need help to use embedding spreadsheet in iLogic

02-11-2014 11:34 AM in reply to: pcrawley

Just found the problem.

Inventor cannot find the worksheet if using Insert Object, this issue have been happened from 2011 Version or more older. Do not know why Autodesk still not solve this issue. Even in torturial, "Insert Object" is still introduced even it does not work. We need to use Link (check "embed") under Parameters. And the Line 1 of the worksheet cannot be same as your current parameters.

Rest, all of my code works fine.

 

Anyway, thanks lot for yor help.

Rich

Autodesk Inventor Professional 2014 (64 Bit Edition)
Build: 246, Release 2014 SP2 Update 2
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
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.