SDK User Tools- Auto Customize Tool
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys,
I'm trying to take advantage of some of the "hidden" features/tools within Inventor including the AutoCustomize Add In that is installed when you run the usertools.msi in the C:\Users\Public\Documents\Autodesk\Inventor 2022\SDK directory. I've read through the Readme.txt multiple times and I seem to keep getting stuck on the 2nd step of the "How to Use this Tool". Include below is the full text from the Readme.txt file for context.
I have a macro that a fellow designer created called DwIOR.ivb. As I understand it, this AutoCustomize Add In is supposed to allow me to make this custom macro more easily available to other users. That sounds great! The problem is with step 2 of How to Use this tool.
2. Load the IVB file into AutoCustomize
Use the Tools->Macros->AutoCustomize... command. Click on Add... button. Click on the Load... button and select your VBA project. Locate your
VBA project in the displayed list of VBA projects. Select your VBA project and press the Add button.
I have registered the AutoCustomize tool using regasm.exe and I have copied the files per the instructions below to the suggested ..\Macros folder. I can't seem to find the "Click on Add... button. Click on the Load... button and select your VBA project. Locate your VBA project in the displayed list of VBA projects. Select your VBA project and press the Add button".
When I click on Tools-->Macros I get this.
Where can I find the Add Button?
AutoCustomize Tool Readme.txt below.
=======================
DESCRIPTION
AutoCustomize is an Add-in which demonstrates how using Inventor API you can write an application that will simplify usage of VBA macros
by making them available as icons in the correct panelbars.
Disclaimer
This tool is not supported by Autodesk. The source code is provided to demonstrate how to write such an application.
End-user features:
+ No VBA knowledge or familiarity required
+ Commands automatically added to a panelbar to the desired Environment (part/sketch/assembly/drawing etc.)
Macro author features:
+ Macros live in any Inventor VBA user project (ivb file) simplifying the maintenance of these macros.
+ Customized UI for each command (Display name, tooltip, help string and icon)
+ Easy to package and distribute VBA project (ivb file, customization xml file and the icon files) in a zip file
Who should use this tool?
-------------------------
Like many Inventor API users, you may have written VBA macros that do something useful. If you want to make these macros available for usage by other
Inventor users, you may find this tool convenient. Using this tool, any Inventor user can use your macros without knowing anything about VBA.
To use the tool, while writing your VBA macros you need to follow a few simple naming rules.
Installing the tool
-------------------
1. Register the tool.
2. Look in the AutoCustomize\Projects folder,and locate the following files and folders:
AutoCustomizeProjects.xml
AutoCustomize.ivb
AutoCustomize.xml
Images\*.*
Note: AutoCustomize.ivb contains a few sample VBA macros from the Autodesk Inventor documentation.
3. Copy the above files and folders to "...\My Documents\Inventor\Macros" folder.
How to use this tool
-------------------
End-user
Let us say that another Inventor user has given you a useful VBA macro, and asked you to use AutoCustomize to use the macro.
Steps:
1. Install the ivb file on your machine
Expand the given zip file in the folder: "...\My Documents\Inventor\Macros". This will save the given ivb file and any XML files or icons
file in the suitable folder.
2. Load the IVB file into AutoCustomize
Use the Tools->Macros->AutoCustomize... command. Click on Add... button. Click on the Load... button and select your VBA project. Locate your
VBA project in the displayed list of VBA projects. Select your VBA project and press the Add button.
3. Use the macro
The macro will become available in a panelbar in the suitable environment. Now you can use the macro.
Macro author:
Let us say that you have written a VBA macro that does something useful, and you want to make the macro available to another end-user.Here are the steps
for doing so.
Steps:
1. Prepare an IVB file
2. Load the IVB file into AutoCustomize
3. Customize each command by changing its display name, tooltip, help string and icon.
4. Create a zip file for ditribution.
1. Prepare an IVB file
After you have tested this VBA macro, firstly add it to a module of a VBA user project. Now name the module using a simple naming convention. This will ensure that
the command is available only in the target Environment for the command. Now load your VBA projects using Tools->Macros->AutoCustomize...command. This will
add your commands to panel bar for the target Environment.
Rule#1: Store your VBA macros in their own user project (ivb file) such that all the subroutines and functions etc. that it needs are available in the same VBA project.
Rule#2: Name the module using the following convention:
------------------------------------------------------------------
Module name Environment
------------------------------------------------------------------
Commands_Assembly Assembly Environment
Commands_Assembly Sketch AssemblySketch Environment
Commands_Weldment Weldment Environment
Commands_WeldmentFeature WeldmentFeature Environment
Commands_Drawing Drawing Environment
Commands_Drawing_Sketch DrawingSketch Environment
Commands_Presentation Presentation Environment
Commands_Sheet_Metal SheetMetal Environment
Commands_Notebook Notebook Environment
Commands_Construction PMxPartConstruction Environment
Commands_Part Part Environment
Commands_Sketch Part Sketch Environment
Commands_Sketch3D Part Sketch3d Environment
Commands_Explicit Part SolidEdit Environment
Commands_Inventor MainFrame Environment
Rule#3: Save your ivb file in the folder: "...\My Documents\Inventor\Macros"
2. Load the IVB file into AutoCustomize
Open VBA user-interface. Load your VBA project using File->Load Project... command.
Use the Tools->Macros->AutoCustomize... command. Click on Add... button, select your VBA project and press the Add button.
3. Customize each command by changing its display name, tooltip, help string and icon.
Use the Tools->Macros->AutoCustomize... command. Select your IVB file in the left column. Click the "Edit commands..." button.
Select the environment for which you have added the commands. Edit the commands.
----------------------------------------------------------------------------------------------------------------------------------
Note: This is not the only way to customize the macros. If you add your macro to your Application project, you can make this macro available
as an icon in a panelbar that is available only in the target Environment. You can do that by using Tools>Customize>Commands... command.
This is covenient for your personal usage. When you want to distribute your macro, you have to ask users to modify
their default application VBA project. In that situation, that is not advisable as changing the default VBA project is difficult for
most Inventor users.
----------------------------------------------------------------------------------------------------------------------------------
To register the AddIn, use regasm.exe (type regasm /codebase "dllName.dll" at the Visual Studio command prompt,
while you are using a 64bit OS you need to use the X64 Win64 Command Prompt. In this case the assembly is bin\Release\AutoCustomize.dll)
To unregister the AddIn, use regasm.exe (type regasm /u "dllName.dll" at the command prompt. In this case the assembly is
bin\Release\AutoCustomize.dll)
Language/Compiler: VC# (.NET)
Server: Inventor.