AutoDesk Inventor – Batch RENAMING COMPONENTS IN THE BROWSER with iLogic
Hello fellow CAD enthusiasts!
Ever been daunted by the mismatch between your file names and display names in Autodesk Inventor? If you’ve renamed a batch of parts or assemblies and then realized the display names in the browser are still the old ones, you’ll know the frustration. The tedious task of manually renaming each one in the browser isn’t something we look forward to.
Enter iLogic – Autodesk Inventor’s powerful automation tool. Today, I’m excited to guide you through a simple yet transformative iLogic code that can remedy this situation in mere seconds!
What does the code do?
This iLogic code automatically updates the display names of parts or assemblies in the Inventor browser to match their file names. Instead of spending hours manually renaming each item in the browser, this code does it all at once. A time-saving lifesaver, indeed!
The video below gives a demonstration of how it works.
To use this rule yourself, open the iLogic browser in an Inventor session. Create a new rule called “ResetDisplayNames“, and paste the following code into the rule before saving and running the rule.
' This iLogic rule will reset the display name of the active document (part or assembly) and its components if it's an assembly Dim oDoc As Document = ThisApplication.ActiveDocument Select Case oDoc.DocumentType Case DocumentTypeEnum.kPartDocumentObject 'If it's a part document Dim oPartDoc As PartDocument = oDoc oPartDoc.DisplayName = "" Case DocumentTypeEnum.kAssemblyDocumentObject 'If it's an assembly document Dim oAsmDoc As AssemblyDocument = oDoc oAsmDoc.DisplayName = "" ' Reset the display name for each component For Each oCompOcc As ComponentOccurrence In oAsmDoc.ComponentDefinition.Occurrences oCompOcc.Name = "" Next Case Else MessageBox.Show("This script supports only part and assembly documents.") Return End Select ThisApplication.ActiveView.Update()
Why use iLogic for this?
- Automation: With iLogic, you can easily automate repetitive tasks. Why do it manually when you can have a code do it for you?
- Consistency: Ensure all parts and assemblies within a project have matching filenames and display names, making it easier to navigate and manage.
- Efficiency: Reduce the time you spend on administrative tasks, giving you more time for actual design work.
Wrapping Up
Automating tasks in Autodesk Inventor with iLogic is more than just a neat trick. It’s a significant step towards enhancing your productivity, ensuring consistency, and refining your design process. This code is just the tip of the iceberg. Dive into the world of iLogic, and you’ll discover countless ways to streamline your CAD workflow.
If you found this blog post useful, do check out the video and share it with fellow designers. And don’t forget to drop your thoughts, suggestions, or questions in the comments below. Let’s innovate together!