SDK User Tools- Auto Customize Tool

SDK User Tools- Auto Customize Tool

amarinXG8V6
Advocate Advocate
701 Views
7 Replies
Message 1 of 8

SDK User Tools- Auto Customize Tool

amarinXG8V6
Advocate
Advocate

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". 

 

amarinXG8V6_0-1729032317028.png

 

When I click on Tools-->Macros I get this.

amarinXG8V6_1-1729032423746.pngamarinXG8V6_2-1729032456918.png

 

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.

0 Likes
702 Views
7 Replies
Replies (7)
Message 2 of 8

Michael.Navara
Advisor
Advisor

This addin sample is obsolete. Use regasm.exe is not supported since 2024. You need to add registration manifest to the project and use them to register this addin. Sample content is in attachment. You need to rename this file to AutoCustomize.Inventor.addin

Then follow standard instructions for registry-free addins for installation and distribution.

 

Tested on 2025 version and it works as expected.

MichaelNavara_0-1729059453895.png

 

Message 3 of 8

amarinXG8V6
Advocate
Advocate

Hi Michael,

 

Thank you for the detailed response. I should have also clarified which version of Inventor I'm doing this on. I'm currently using 2022 Inventor Professional. Where can I find the installation instruction for registry free addins?

I understand that I will take the file you provided, rename it by removing the .xml extension and then I'm left with just AutoCustomize.Inventor.addin. I'm going to move this file into my C:\ProgramData\Autodesk\Inventor 2022\Addins folder. I will then make sure that the load behavior is what I want. 

 

It's now in my list of Addins but for some reason I can't get the load behavior to stick to "Loaded". It keeps toggling back to "Unloaded".

amarinXG8V6_1-1729092494314.png

 

When I then open an Assembly, I do not see the AutoCustomize ribbon as you have it which makes sense because the addin isn't actually loaded in. Could you help identify what step I'm missing?

 

amarinXG8V6_0-1729092285193.png

 

Thanks again for the help!

0 Likes
Message 4 of 8

JelteDeJong
Mentor
Mentor

There can be several reasons why an addin won't load. Some time ago I wrote a blog post with steps that you can follow to identify the problem. Here you can find the post "Help: My addin won't load". I guess you could start at point 3.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 5 of 8

Michael.Navara
Advisor
Advisor

I try to do it on Inventor 2022 with UserTools2022 and I need to do following

  1. Create .addin file mentioned above
  2. Copy the file to "C:\ProgramData\Autodesk\Inventor AddIns\" (addins for all users and all Inventor versions)
  3. In .addin file change the path in assembly node to full path of AutoCustomize.dll 
    <Assembly>D:\Path\To\UserTools_2022\UserTools\AutoCustomize\bin\Release\AutoCustomize.dll</Assembly>
  4. Copy content of
    "D:\Path\To\UserTools_2022\UserTools\AutoCustomize\Projects\"
    to
    "C:\Users\<UserName>\Documents\Inventor\Macros\"
  5. Start Inventor

Some unhandled exceptions occur when I try to change the configuration, but the add-in is successfully loaded. 

MichaelNavara_0-1729146306028.png

 

 

 

Message 6 of 8

amarinXG8V6
Advocate
Advocate

@Michael.Navara ,

 

I followed the instructions that you provided. See screenshot below of edited .addin file.

 

amarinXG8V6_0-1729270564775.png

 

I have a couple of follow up questions. In my Applicaiton Options, should I point the directory to the AutoCustomization. ivb or the Default.ivb?

 

amarinXG8V6_1-1729270689782.png

Now when I open an assembly I see the AutoCustomization in the AddIn tab. It doesn't however create a new ribbon toolbar like what you have shown.

 

amarinXG8V6_2-1729270741297.png

 

When I launch the application and hit Refresh, I get this code. Is this something that you can help identify the issue?

 

I don't want this to point to a OneDrive location. I'm not sure why it's defaulting to this location.

 

amarinXG8V6_3-1729270829047.png

 

amarinXG8V6_4-1729270844203.png

 

Thank you,

 

 

0 Likes
Message 7 of 8

Pineapple2024
Advocate
Advocate

You're mixing it up.

ivb is VB Macro file, not an addin.

You need to open VBA editor to us it.

 

Addin are compiled into dll.

0 Likes
Message 8 of 8

amarinXG8V6
Advocate
Advocate

I thought the same thing you just mentioned originally. That this is a macro and not an addin but then others mentioned how it is obsolete and how I need to load it into my Inventor as an addin instead of going through the regasm.exe to register the addin. There is a DLL file that is created when you install this custom UserTool. The .addin file came from @Michael.Navara who mentioned loading it this way. He provided it as a .addin.xml and then mentioned that I need to convert it to a .addin and also change one of the lines in the code through visual studio, which I also did. 

 

.Dll file location created after running the AutoCustomize Tool .exe.

amarinXG8V6_0-1729278692239.png

 

Files that I'm supposed to copy in to my ..\Macros folder. This is the location that the AutoCustomize.exe installer puts them in.

 

amarinXG8V6_1-1729278766300.png

 

The .addin file was a file was provided in this post and I followed the instructions to renaming it, moving it into the ..\Addins folder and changing some of the code to explicitly point to the directory where the .dll file is located.

amarinXG8V6_3-1729278935390.png

 

amarinXG8V6_2-1729278855024.png

amarinXG8V6_4-1729279011411.png

 

I included the Readme.txt as reference.

amarinXG8V6_5-1729279113317.png

 

0 Likes