Inventor General Discussion

Inventor General Discussion

Reply
*Iwaskewycz, Brian R.
Message 1 of 14 (72 Views)

iParts - Did you know?

72 Views, 13 Replies
11-12-2003 03:16 AM
If you edit your iPart tables with Excel, you can use standard Excel
functions and user-defined VBA functions to calculate required fields?

 

Take a bolt for example.  Say column A contains the nominal size,
column B contains the length, and column C contains the filename.  Let's
say cell A2 holds '0.25-20 UNC' and cell B2 holds '2.5', and we want the
filename to read '0.25-20 UNC - 2.5 LONG'.  Instead of cutting and pasting,
you can put a formula into cell C2 that reads '=concatenate(A2, " - ", B2, "
LONG")'.  Furthermore, since it's a function, if you change the length in
B2, for example, the filename (C2) will update without having to fix it
accordingly.

 

You will have to change the cell format first in order to input a
function.  Inventor creates the cells as text, so you'll have to change the
format to something else (like "General") for Excel to interpret the
function.

 

This is just a very simple example and can be extended to a myriad of
different applications.

 

A warning comes with this tip, though - if you use Excel functions to
define a cell, you cannot edit that cell with the built-in iPart table
editor.  The cells are red and can only be modified in Excel.

 

Maybe this helps someone out there.  My apologies if this is already
common knowledge, 'cause I just figured this out on my own, and it's coming in
VERY handy.




Brian R.
Iwaskewycz

Senior Mechanical Engineer
PA Transformer
Technology, Inc.
*Keller, Kent
Message 2 of 14 (72 Views)

Re: iParts - Did you know?

11-12-2003 03:34 AM in reply to: *Iwaskewycz, Brian R.
One word of warning. I had used some VBA in a few iPart tables a couple of releases back
and it ended up causing corruption problems. The issue may be fixed now, but I haven't
checked to see 8^) If you use vba macros in Excel I would suggest making sure to delete
them once you are done.

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Brian R. Iwaskewycz" wrote in message
news:F7B3CB8D2A85C37452B4B6C450D51166@in.WebX.maYIadrTaRb...
> If you edit your iPart tables with Excel, you can use standard Excel functions and
user-defined VBA functions to calculate required fields?
*Iwaskewycz, Brian R.
Message 3 of 14 (72 Views)

Re:

11-12-2003 03:34 AM in reply to: *Iwaskewycz, Brian R.
Macros (which I assume to be subs) or functions? Or doesn't it matter?

"Kent Keller" wrote in message
news:smileyvery-happy:5EB04382A6AA5D324F325A094455C1A@in.WebX.maYIadrTaRb...
> One word of warning. I had used some VBA in a few iPart tables a couple
of releases back
> and it ended up causing corruption problems. The issue may be fixed now,
but I haven't
> checked to see 8^) If you use vba macros in Excel I would suggest making
sure to delete
> them once you are done.
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
*Keller, Kent
Message 4 of 14 (72 Views)

Re:

11-12-2003 03:41 AM in reply to: *Iwaskewycz, Brian R.
I am pretty sure I had only used subs, but I wouldn't risk leaving any code in the iPart
Parent table. As I said, for all I know the issue could be fixed, but probably not worth
the risk.

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Brian R. Iwaskewycz" wrote in message
news:45248A7D291C94358AA562E65FCD23D1@in.WebX.maYIadrTaRb...
> Macros (which I assume to be subs) or functions? Or doesn't it matter?
*Iwaskewycz, Brian R.
Message 5 of 14 (72 Views)

Re:

11-12-2003 03:41 AM in reply to: *Iwaskewycz, Brian R.
I guess I'll be the guinea pig here then. Seems to be working ok for now,
but we'll see. Thanks for the warning.

"Kent Keller" wrote in message
news:1DCE0CAC836BF464E7DEDF875B672F4C@in.WebX.maYIadrTaRb...
> I am pretty sure I had only used subs, but I wouldn't risk leaving any
code in the iPart
> Parent table. As I said, for all I know the issue could be fixed, but
probably not worth
> the risk.
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
*Keller, Kent
Message 6 of 14 (72 Views)

Re:

11-12-2003 03:57 AM in reply to: *Iwaskewycz, Brian R.
I wouldn't if I was you. Here is from a old post of mine, might want to keep it handy.
8^) Since they felt the issue was a OLE one I doubt it has been fixed. And trust me
fixing a bunch of library iParts is no treat.


iPart Network connection may have been lost

Tom McNeil at Autodesk has informed me of a issue that shows up on some of the iParts off
my Web site. I have not had a chance to check them all, but there are a few that have a
VBA macro in the iPart Excel table. The Macros were simple little snips of code that I
used when building the table. They should have had no affect on the part, but it appears
there is some sort of problem (if I understand correctly the problem is with OLE more-so
than anything with Inventor)

At this point I have only had time to go through a few of the parts on my site to check
them out. Consequently I have removed the iPart page until I can make sure all will be
OK.

As I understand it if you had downloaded one of the iParts with VBA in the Excel file and
been using it you would have seen the problem. It would be something along the lines of a
error message saying "Network connection may have been lost". "Not enough storage is
available to complete this operation. OK."

If you are getting any errors like that when placing iParts you can take these steps to
clean the file.

1. Open the file in question.

2. Select the iPart table, right mouse menu, select "Delete"

You will be prompted to verify that you want the iPart turned into a normal part, select
'yes'

The previously hidden embedded file is now visible under the 3rdParty folder.

By turning this table into a normal 3rdParty item, you will bypass table code that is used
to determine if the table is clean, healthy, and well structured.

This is extra layer of code was preventing us from editing Excel, since it would open and
then close Excel.

3. Select this new embedded item, right mouse menu, select 'Edit'

Excel should start and be visible in it's own window.

4. Scroll down to the bottom of the iPart table.

5. Several rows *AFTER* the last iPart row, add a value into an empty cell.

It is necessary for Excel to really think it is dirty and needs to save, and this simple
edit should accomplish that.

I am going to add to Toms notes to Press Alt F11 and double click on each of the Sheets
and "ThisWorkbook" in the Project browser window and if you see any text in any of the
pages then delete it. Close the window, and follow the rest of the steps.

6. Save and close Excel.

When Excel saves, it "migrates" it's data.

7. Back in Inventor, undo back over the Table 'Delete' so that the table reappears

Edits directly to the excel data as not part of Inventor's transacted data, so the edits
will not get undo

8. (optional) You can now removed the "bogus" cell data that was added in step #4 using
"Edit via Spreadsheet" on the iPart Table.

I will be fixing the parts from the site as time permits. I plan on also doing a little
bit of cleanup work on the tables so it may take some time. When I put them back up I will
post a list of the ones I found to have VBA in the Excel table so you won't have to
download any that didn't have problems.


I sincerely apologize for the inconvenience.

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program
*Dotson, Sean
Message 7 of 14 (72 Views)

Re:

11-12-2003 05:12 AM in reply to: *Iwaskewycz, Brian R.
I know the error you speak of Kent but in Brian's example he's not using
VBA. He's just using the built in Excel function which we have been using
since they introduced iParts (R3/4?) so there should be no problem.

--
Sean Dotson, PE
http://www.sdotson.com
Check the Inventor FAQ for most common questions
www.sdotson.com/faq.html
-----------------------------------------------------------------------
"Kent Keller" wrote in message
news:smileyvery-happy:5EB04382A6AA5D324F325A094455C1A@in.WebX.maYIadrTaRb...
> One word of warning. I had used some VBA in a few iPart tables a couple
of releases back
> and it ended up causing corruption problems. The issue may be fixed now,
but I haven't
> checked to see 8^) If you use vba macros in Excel I would suggest making
sure to delete
> them once you are done.
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
> "Brian R. Iwaskewycz" wrote in message
> news:F7B3CB8D2A85C37452B4B6C450D51166@in.WebX.maYIadrTaRb...
> > If you edit your iPart tables with Excel, you can use standard Excel
functions and
> user-defined VBA functions to calculate required fields?
>
>
*Keller, Kent
Message 8 of 14 (72 Views)

Re:

11-12-2003 05:52 AM in reply to: *Iwaskewycz, Brian R.
True his examples are just Excel functions but his very first statement was
[Quote] If you edit your iPart tables with Excel, you can use standard Excel functions and
user-defined VBA functions to calculate required fields? [/Quote]

and there was talks of subs vs functions.

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Sean Dotson" wrote in message
news:40C79D64603C0A04B12A4A38DFBC326E@in.WebX.maYIadrTaRb...
> I know the error you speak of Kent but in Brian's example he's not using
> VBA. He's just using the built in Excel function which we have been using
> since they introduced iParts (R3/4?) so there should be no problem.
>
> --
> Sean Dotson, PE
> http://www.sdotson.com
> Check the Inventor FAQ for most common questions
> www.sdotson.com/faq.html
*Dotson, Sean
Message 9 of 14 (72 Views)

Re:

11-12-2003 08:19 AM in reply to: *Iwaskewycz, Brian R.
Ah, I just skipped to the juicy part. Didn't see his mention of VBA. But
again for the record for everyone else, what he's doing is not VBA related.

--
Sean Dotson, PE
http://www.sdotson.com
Check the Inventor FAQ for most common questions
www.sdotson.com/faq.html
----------------------------------------------------------------------------
------
"Kent Keller" wrote in message
news:161893CAE26758FE5C41F4DF0FBFF458@in.WebX.maYIadrTaRb...
> True his examples are just Excel functions but his very first statement
was
> [Quote] If you edit your iPart tables with Excel, you can use standard
Excel functions and
> user-defined VBA functions to calculate required fields? [/Quote]
>
> and there was talks of subs vs functions.
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
> "Sean Dotson" wrote in message
> news:40C79D64603C0A04B12A4A38DFBC326E@in.WebX.maYIadrTaRb...
> > I know the error you speak of Kent but in Brian's example he's not using
> > VBA. He's just using the built in Excel function which we have been
using
> > since they introduced iParts (R3/4?) so there should be no problem.
> >
> > --
> > Sean Dotson, PE
> > http://www.sdotson.com
> > Check the Inventor FAQ for most common questions
> > www.sdotson.com/faq.html
>
>
*Iwaskewycz, Brian R.
Message 10 of 14 (72 Views)

Re:

11-12-2003 09:17 PM in reply to: *Iwaskewycz, Brian R.
Correct, Kent. One of the functions I'm using is a user-defined VBA
function.

I wrote a simple function to make fractions in Excel appear better. In
Excel, set the cell format to Fraction, Up to 2 digits. Now type 1.5 in the
cell. It appears as "1 1/2" (note the two spaces between the 1 and the
1/2). This was enough (doesn't take much) to drive me crazy and write my
own routine that displays it without the space. The good news is that if I
do have problems with the iPart because of the VBA function, I can remove it
without having any serious negative effect on the functionality of the
iPart - just the Description field and the filename have those annoying
extra spaces in them.

"Kent Keller" wrote in message
news:161893CAE26758FE5C41F4DF0FBFF458@in.WebX.maYIadrTaRb...
> True his examples are just Excel functions but his very first statement
was
> [Quote] If you edit your iPart tables with Excel, you can use standard
Excel functions and
> user-defined VBA functions to calculate required fields? [/Quote]
>
> and there was talks of subs vs functions.
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.