It does not always have to be grease, metal forming, plastic injection, FEA calculations here at the mechanical division of Autodesk. Sometimes we have a sweet tooth and start daydreaming about being in the chocolate business :-)
Now that I caught your attention, I would like to use the chocolate industry as an excuse to discuss the problem of engraving or embossing the part number on a series of parts.
There have been heated discussions in the past about this topic on the newsgroups, here is just an example of such a discussion.
Each part in the series has to have a different a different part number of course.
For simplicity sake, we assume that we use the part number as the text for the engraving and that it can be found in a sketch called "Engraving".
Note: all Inventor sample parts downloadable from this article are in 2012 format although everything explained here is valid for earlier versions as well, except for Solution 3.
Figure 1 : family of parts with different emboss text
Obstacles
The first obstacle is that sketch text CANNOT be used as a variable in an iPart table.
The second obstacle is that although you can create a user parameter of the type text or a custom iProperty of the type text, neither of these can be used as such in a sketch text.
Sketch text only allows the use of static texts or parameters with numeric values.
And as you might understand, static text does not really help when you want to to create a series of parts :-(
I envisioned to use a macro or iLogic rule to copy the part number in a sketch text.
However when creating a family of parts that almost inevitably leads us to the use of iParts.
And here we stumble on a third obstacle: macros and iLogic rules automatically get expelled from iPart members :-(
So the only place to safely store and run macros or rules is in the iPart factory itself.
The iPart members that get generated can thus have different engravings as long as the engravings are created by a macro/rule in the iPart factory BEFORE the iPart members get created. Here are three possible solutions.
Solution 1 : iPart + Excel + VBA
If you have a small family of parts, you could use a regular iPart and include all embosses in the ipart factory and suppress the embosses you don't need in a particular ipart member.
You can decide to change the text in each emboss manually. Solution 1 is handy if you want to change all emboss texts from a central location, in this case I use Excel as that central location. A single linked Excel spreadsheet defines the text and in which emboss sketch it goes. It assumes that only one spreadsheet is linked into the ipt (the name is unimportant) and a single "dummy" text per sketch is embossed.
Pros: preview is available, use of familiar iPart technique
Cons: complex, needs programming although the code is quite reusable for other cases, extra file needed (Excel), complexer modeling, larger file size, not suited for larger families of parts
Putting it in action
Download and unzip the Engraving1.zip file.
Open the Engraving1.ipt file and simply run the macro called "Emboss_with_text_from_Excel".
After that you can activate each iPart member in the table to see if the results are as expected.
Click here to inspect the VBA macro
Note: the code only works if the Excel spreadsheet is linked into the part (not embedded) and the second condition is that in the VBA editor the Excel object library is loaded via the Tools > References menu.

Here is how I have set up the linked spreadsheet called "Engraving.xls"

Here is how the iPart is set up. To make the iPart table and the spreadsheet communicate correctly with each other, I made sure that my naming conventions for the features made sense.

As an example: the 3rd member in the table uses Emboss3 (all other embosses are suppressed).
Emboss3 uses sketch Engraving3 which on its turn uses the text "Leonidas 100 gr" as can be seen in the spreadsheet etc
The other advantage of Solution 1 is that it allows you to decide in which sketch the emboss text needs to go. This is necessary because every emboss will need to use a separate sketch to avoid confusion.
Solution 2 : iPart + VBA
This solution uses an iPart and a macro to generate members while stripping out the iPart table from the members to prevent wrong information from being introduced in the members at a later stage.
Pros: familiar iPart technique, code is reusable in other cases, solution valid for all releases, suited for larger families of parts, generates all variations with a single command,
Cons: relatively complex, needs programming + iPart, no preview (iPart factory is not able to show the resulting engraving part)
Putting it in action
Open Engraving2.ipt
Run the macro called " ipart_member_generation"
After the macro runs succesfully, you will see 3 member files on disk with the correct part numbers as determined in the iPart table (Leonidas 100 gr.ipt, Godiva 250 gr.ipt, Neuhaus 500 gr.ipt).
The part number is also used for the engraving.
The macro automatically removes the table in the iPart members to always ensure a correct but static part number text. If the factory changes, simply rerun the macro to regenerate all members.
Click here to inspect the VBA macro
Solution 3: iLogic
With the advent of forms in iLogic since release 2012, this is probably the simplest method.
I used 3 simple iLogic rules and 1 iLogic form to drive the different engravings plus a couple of parameters.
The only set-up that needs to be done is to create a multi-value text parameter that defines the engraved text and also the file name. I called that parameter "boxtype" and it contains three values.

Pros: simple solution , rules can be modified quite easily for other cases, suited for larger families of parts
Cons: solution only valid for R2012 (due to the use of forms)
Putting it in action
Open part called Engraving3.ipt.
It has 3 rules and a form included in the part. Just run the form.
The rules allow you to set the box overall size, change the engraved text and save a copy of the file to a new file name in the workspace.
Rule 1: Update size values
This rule simply adjusts the size parameters depending on the value of the boxtype
boxtypetext = Parameter.Param("boxtype")
If boxtypetext.Value ="Neuhaus 500 gr" Then
d0 = 150 mm
d1 = 70 mm
d2 = 50 mm
Else If boxtypetext.Value = "Goodyear 250 gr" Then
d0 = 110 mm
d1 = 70 mm
d2 = 50 mm
Else If boxtypetext.Value ="Leonidas 100 gr" Then
d0 = 100 mm
d1 = 30 mm
d2 = 25 mm
|End If
Rule 2: Change engraving and size
This rule changes the engraving by using the value of the boxtype text. I use an Arial 1 pt font.
I also run Rule 1 to make sure that the dimensions are up to date prior to changing the engraving.
iLogicVb.RunRule("Update size values")
boxtypetext = Parameter.Param("boxtype")
Dim odoc AsPartDocument
odoc = ThisApplication.ActiveDocument
Dim osketch As Sketch
osketch =odoc.ComponentDefinition.Sketches.Item("Engraving")
osketch.TextBoxes.Item(1).FormattedText ="<StyleOverride Font='ARIAL' FontSize='1'>"+boxtypetext.Value+"</StyleOverride>"
odoc.Update
Rule3: Save file as copy
This rule saves the results out to disk in the workspace and uses the boxtype text to compose the file name
You could ask yourself why I did not combine Rules 2 and 3. Well the save operation cannot happen in the same rule where a parameter change happens (this is a known limitation), hence why I had to create the extra rule for the save.
boxtypetext = Parameter.Param("boxtype")
Dim outputfile As String
outputfile = ThisApplication.FileLocations.Workspace +"\"+boxtypetext.Value +".ipt"
ThisDoc.Document.SaveAs (outputfile, True)
Form:
I called it the "Chocolate box configurator" for lack of a better name :-)
The form allows you to select your configurations and preview the 3 size parameters before committing to the change.

The "Change engraving and size" and "Save file as copy" buttons correspond to the rules with the same name. The "Update" button corresponds to the Update size values rule.
The 3 size fields are read-only and are updated with the "Update" button after selecting a new boxtype.
I also removed the default "Done" button from the dialog and made sure that the "Change engraving and size" and the "Save file as copy" rules do not trigger automatically.
This way I have full control over when to update the engraving and when to create the file on disk.
Enjoy!
Bob