LYNTRX by BayTech
DEFREN

Inventor practice · iLogic · iProperties · Title block

Let Inventor write the stock size into the drawing.

Round bar Ø 45 × 128, 3 mm sheet, HEA 200 beam: typing the stock size into the title block by hand takes time and is a classic source of errors. With one iProperty and a short iLogic rule, Inventor derives it from the geometry and writes it into the drawing and parts list itself.

The principle

  1. The stock size is an iProperty of the part – not text in the drawing.
  2. An iLogic rule derives it from the geometry and writes it into the iProperty.
  3. An event trigger runs the rule before every save.
  4. The title block and parts list read the iProperty from the model.

That way the information stays correct even if the part later becomes longer or thicker.

Step 1: Choose the right iProperty

The existing “Stock Number” iProperty (on the Project tab of the iProperties) is the best fit. It is available as a parts list column and can be used in the title block directly. If you already use Stock Number for something else, create a custom iProperty “Stock size” – preferably in the part template, so it exists in every part.

Step 2: Link the title block and parts list

In the drawing template, edit the title block under Drawing Resources › Title Blocks, add a text field and select the type “Properties – Model” with the property “Stock Number”. Show the “Stock Number” column in the parts list. From now on the drawing shows what is in the model.

Step 3: The iLogic rule for turned parts

For round bar, the part's extents are enough: two equal dimensions are the diameter, the third is the length. The rule adds a machining allowance, rounds up to the next stocked diameter and rounds the length up to 5 mm:

' Stock size for turned parts from the part geometry (round bar)
Dim doc As PartDocument = ThisDoc.Document
Dim b As Box = doc.ComponentDefinition.RangeBox
Dim m() As Double = {(b.MaxPoint.X - b.MinPoint.X) * 10, _
                     (b.MaxPoint.Y - b.MinPoint.Y) * 10, _
                     (b.MaxPoint.Z - b.MinPoint.Z) * 10}   ' Inventor works internally in cm
Array.Sort(m)

Dim d As Double, l As Double
If Math.Abs(m(0) - m(1)) < 0.1 Then
    d = m(1) : l = m(2)          ' shaft: length is the largest dimension
ElseIf Math.Abs(m(1) - m(2)) < 0.1 Then
    d = m(2) : l = m(0)          ' disc, flange: length is the smallest dimension
Else
    Exit Sub                     ' not a turned part - do not overwrite anything
End If

' Stocked round bar diameters (example - replace with your own stock list)
Dim stock() As Double = {10, 12, 16, 20, 25, 30, 32, 35, 40, 45, 50, 55, 60, 65, 70, 80, 90, 100, 110, 120}
Dim dRaw As Double = d + 3                           ' diameter allowance per house standard
Dim dStock As Double = 0
For Each n As Double In stock
    If n >= dRaw Then dStock = n : Exit For
Next
If dStock = 0 Then Exit Sub                          ' larger than stock list: enter manually

Dim lStock As Double = Math.Ceiling((l + 4) / 5) * 5 ' length allowance, rounded up to 5 mm
iProperties.Value("Project", "Stock Number") = "Rd " & dStock & " x " & lStock & " – " & iProperties.Material

Three notes:

  • The rule assumes that the axis of rotation lies on an origin axis. That is good practice for turned parts anyway.
  • The extents (RangeBox) are not always perfectly tight. For edge cases, the largest diameter can be determined more precisely from the cylindrical faces.
  • Allowances and the stock list are example values. They belong in your house standard and are best maintained in one place, such as an external rule or an Excel table.

Step 4: Run it automatically

Store the rule as an external rule and assign it to the “Before Save Document” event in the iLogic event triggers, for all part documents. Nobody has to remember the rule any more, and older parts get their stock size the next time they are saved.

Other kinds of stock

Part typeWhere the information comes from
Sheet metal partsFlat pattern size (in iLogic SheetMetal.FlatExtentsLength and FlatExtentsWidth) and thickness from the sheet metal rules
Frame Generator profilesContent Center profiles already carry the designation and length (parameter G_L)
Flat bar, platesExtents as for turned parts, but round all three dimensions to stocked thicknesses and cut sizes

Last updated: November 2026 · Tuncay Bay, BayTech GmbH, Lucerne · All Inventor practice articles

Questions

Frequently asked questions

Why not simply use the “Material” iProperty?

Material describes the grade, not the raw form. Production planning needs both: which material and which stock the part is made from. The rule above therefore combines the two.

Does this work in Inventor 2020 as well?

Yes. iLogic, iProperties and event triggers already exist in Inventor 2020; the rule runs there just the same.

What happens if someone changes the stock size by hand?

The rule overwrites the value on the next save. If you need exceptions, add a second iProperty as a switch, for example “Stock size manual”, and let the rule check it.

Can this be done without iLogic?

For many parts at once, or as part of a Vault job server, an add-in using the Inventor API is worthwhile. BayTech GmbH builds such automations as a service; for turned parts, LYNTRX2D already enters stock and machining information into the workshop drawing by rule.

Want to automate recurring Inventor work?

Drawing derivation to your house standard, title blocks, parts lists, checking routines: send us a sample part. We will tell you what can be automated.