π Auto Open Drawing from Inventor Part/Assembly
π Problem: Manually Hunting for Associated Drawings
When working on a part or assembly in Autodesk Inventor, finding the matching drawing file can turn into a repetitive, time-wasting search across folders and subfolders.
Every time you need to review or update a drawing, you end up browsing directories, guessing names, and opening multiple files until you finally land on the right one.
This macro removes that friction by automatically opening the associated drawing file for the active model, so you stay focused on design instead of file management.
π What This Macro Does
This VBA macro searches for and opens the drawing file (.idw or .dwg) that matches the currently active Part (.ipt) or Assembly (.iam) file in Inventor.
It looks for drawings with the same base file name and opens the correct one instantly when found.
π Where It Searches
- The same folder as the active part or assembly
- All subfolders, up to 5 levels deep, so you can keep organized structures without losing quick access
If a matching drawing is found, it opens directly in Inventor and is ready for review or editing.
π₯ Demo: See It in Action
π Hereβs what the macro does with just one click:
Automatically open the associated drawing for the active Inventor part or assembly.
β Requirements
To use this macro smoothly, make sure:
- You are running Autodesk Inventor 2015 or later
- VBA support is available and enabled on your Windows machine
- The drawing file uses the same name as the part or assembly
- Example:
Bracket.iptβBracket.idworBracket.dwg
- Example:
π§© Included Files
| File Name | Purpose |
|---|---|
| OpenAssociatedDrawing.bas | The macro module to import |
| README.md | User guide in Markdown format |
These files come together as a small, focused tool you can plug into your existing automation toolbox.
π How to Use the Macro
1. Open Inventor
Start Autodesk Inventor and open any part (.ipt) or assembly (.iam) file that you want to work with.
2. Launch the VBA Editor
Press Alt + F11 to open the built-in VBA Editor inside Inventor.
3. Import the Macro
- Go to
File β Import Fileβ¦ - Select
OpenAssociatedDrawing.bas - The module will appear in your Inventor VBA project tree
4. Run the Macro
- Close or minimize the VBA editor
- Press
Alt + F8, selectOpenAssociatedDrawing, and click Run
If a matching drawing exists, it will open automatically.
π‘ What the Macro Does Internally
Under the hood, the macro performs a series of checks and searches to find the right drawing:
- Confirms there is an active document and that it is a part (
.ipt) or assembly (.iam) - Verifies that the active file is saved, so a folder path is available
- Builds the expected drawing names (
.idwand.dwg) based on the active file name - Scans the working folder and subfolders (up to 5 levels) using a breadth-first search strategy
- Opens the first matching drawing found, or shows an informative message if none exist
β οΈ Possible Error Messages
If something is not set up correctly, you may see one of these messages:
| Message | Cause |
|---|---|
No document is open.
| Inventor has no document open |
Open a Part (.ipt) or Assembly (.iam) file first.
| The active document is not a part/assembly |
Save the file before running the macro.
| The active file has not been saved yet |
No drawing file found in folder or subfolders.
|
No matching .idw or .dwg was found
|
These checks help prevent confusion and guide you toward fixing the underlying issue quickly.
π Performance Characteristics
The search is designed to be both robust and efficient:
- Uses a breadth-first search approach to avoid deep recursion and excessive memory usage
- Limits the search depth to 5 folder levels to keep lookups fast and predictable
This makes the macro safe to use even on large, structured project folders.
πΌ Tips for Power Users
You can get even more out of this macro by following a few best practices:
- Keep associated drawings in the same folder or in well-structured subfolders near the model files
- Use consistent, matching filenames between parts/assemblies and drawings
- Extend the macro to integrate with:
- Autodesk Vault search
- Logging or telemetry
- Automatic drawing creation when no drawing is found
π¦ Download the Macro
You can download the ready-to-use .bas module here:
π Download OpenAssociatedDrawing.bas
Import it into Inventorβs VBA environment and youβre ready to go.
π Multilingual Documentation
The download package includes README guides in multiple languages so teams across regions can adopt the macro easily:
- English
- German
- Chinese
- Japanese
Each language-specific README explains setup and usage so everyone can get started quickly.
π¬ Need Help or Have Ideas?
If you have questions, feature requests, or improvement ideas:
- Leave a comment on the article page
- Or reach out directly via the contact email linked on the site
Feedback helps shape future automation tools and enhancements.
π License
This macro is provided as-is, without warranty.
You are free to adapt, modify, and redistribute it for internal use or client projects as part of your automation workflows.
β¨ Happy Automating!