Over 1.105.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips, Civil tips, Fusion tips.
Try the new precise Engineering calculator.
New AutoCAD 2026 commands and sys.variables and env.variables,.
CAD tip # 12432:
Question
A
With regular expressions in Autodesk Inventor's iLogic rules you can parse and replace part file names or derive, extract and fill individual iProperties of your Inventor documents.
The reg.exp. principles in the search portion is quite simple - the parentheses "()" capture the individual character groups, the braces "{}" define the number of characters. In the replacement portion then you can reference the captured groups with "$1", "$2" etc. (in the capture order). The code "\d" means a digit, the dot "." then any character and the plus "+" means any number of repetitions.
See examples:
' 770203010005.ipt --> Part number 77.02/03.01.00.05 ' EP354-J12(C).ipt --> Part number J12-C/A354 docname = ThisDoc.FileName(False) FN = System.Text.RegularExpressions.Regex.Replace(docname, "\b(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})", "$1.$2/$3.$4.$5.$6") 'FN = System.Text.RegularExpressions.Regex.Replace(docname, "\b(.{2})(\d+)\-(.)(\d+)\((.+)\)", "$3$4-$5/A$2") iProperties.Value("Project", "Part Number") = FN iLogicVb.UpdateWhenDone = True

See also the Tip 6967
Inventor
1.12.2019
18540×
this tip shared by ARKANCE experts applies to: Inventor ·
![CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]](../common/arkance_186.png)

