Build Inventor UI Addin

Build the solution and fix bugs.

As part of the build, the Addin registers automatically for you with Intent.

Open an Assembly. On the ribbon, UIToolsDockableWindow.Addin tab, three buttons display:

This behavior is the default for an Inventor Addin.

To finish, clean up the Addin, and create an instance of the dockable window.

Edit UserInferfaceComponents.cs

  1. In the organizational UI folder of the project, open the file UserInterfaceComponents.cs. This class defines the components of the user interface for the Addin.
  2. The buttons, or many of the generated methods for our add-in are not necessary. In the class UserInterfaceComponents, remove:
    • Everything except the constructor, and the Activate method
    • The implementation inside the constructor and Activate method.
  3. Add a variable of the type ApplicationAddInSite to the UserInterfaceComponents class.
    the implementation inside the constructor and Activate method.
  4. Add a variable to hold an instance of our DockableWindow to the UserInterfaceComponents class.
     private UIToolsDockableWindow uiToolsDockableWindow;
  5. Initialize this variable to the ApplicationAddInSite parameter in the constructor for the UserInterfaceComponents class.
    internal UserInterfaceComponents( ApplicationAddInSite addInSite)
    {
         m_addInSite = addInSite;
    }
    

    The m_addInSite variable holds the ApplicationAddInSite locally, to use when you create the Dockable Window after Intent initializes.

  6. Create a method to instantiate, and show the dockableWindow object.

    internal void createDockableWindow()

     {
          uiToolsDockableWindow = new UIToolsDockableWindow (m_addInSite);
          uiToolsDockableWindow.Show();
    }

    In this method, we use the default value for the DockingStateEnum parameter. To dock the window a different position than the default, add an Inventor.DockingStateEnum parameter to the constructor call. We call the new method createDockableWindow after Intent initializes.

Edit IntentModel.cs

  1. Open the file IntentModel.cs in the root of the project.
  2. In the constructor, remove:
    • Lines that add event handlers to the buttons on the gui, since the buttons no longer exist.
    • "ImportModelButton_OnExecute" method.
    • "ExportModelButton_OnExecute" method.
  3. In the IntentModel class, the variable m_gui holds an instance of UserInferfaceComponents. Use this variable to call the method made earlier to create the dockable window.

  4. Add a call to our method as the last line of the IntentInitialized method.
     m_gui.createDockableWindow();

With the addition of this call, Intent initializes, and you can create the UIInventorProject successfully.

Build Completed Addin

  1. Build the project again.
  2. Open an Inventor assembly that uses intent and is configured for UITools.
  3. A dockable window add-in displays. If necessary, resize some of the existing dockable windows to view the custom add-in.