Macro vs Add-In

Macro vs Add-In

Anonymous
Not applicable
524 Views
2 Replies
Message 1 of 3

Macro vs Add-In

Anonymous
Not applicable

Hey guys,

 

I have build 2 Add-ins for inventor. I used my Inventor 2018 Pro with free license to develop and test the add-ins. Now that they are done and ready to be tested i need to transfer them to the workstations in the office. The workstations use Inventor 2017 Pro. I have an issue transfering the Add-in files when i follow the readme.txt that comes with the template. So for current use i transferred the code to a macro and implemented it this way so functionality can be tested already. Now what is the advantage of using a macro in stead of an Add-in? One of the programs is for coloring first level components in an assembly, which takes a lot of time if it is a big assembly. would it go faster with an Add-in? If not what can i do to make the Add-Ins run on the workstations?

 

cheers,

Rob Rombouts.

0 Likes
525 Views
2 Replies
Replies (2)
Message 2 of 3

Jef_E
Collaborator
Collaborator

It's hard to say why the addin won't load without any code.. I think you might wan't to look into the Inventor.AddIn file for some settings.. maybe 

<SupportedSoftwareVersionGreaterThan>17..</SupportedSoftwareVersionGreaterThan>

IDK



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Message 3 of 3

Anonymous
Not applicable

Hey Jef,

 

Thanks for the reply, I thought it could be an issue with that so i checked it and in my addin file it says from version 21. I also checked the version of inventor on the workstations which is 21.1 so normally it should be ok. are there any 'major' differences between 2017 and 2018? In my first post I had a similar issue and got it fixed by adjusting the images. Could it be that Inventor changed their requirements for images? Normally we update to inventor 2018 next wednesday so I hope we get to install the curretn version succesfully without issues. I'll keep you updated.

 

for further info my .addin file

<Addin Type="Standard">
  <!--Created for Autodesk Inventor Version 22.0-->
  <ClassId>{230cac1d-5709-4684-817a-5f95cf1ab8ee}</ClassId>
  <ClientId>{230cac1d-5709-4684-817a-5f95cf1ab8ee}</ClientId>
  <DisplayName>InventorAddIn2</DisplayName>
  <Description>InventorAddIn2</Description>
  <Assembly>InventorAddIn2.dll</Assembly>
  <LoadOnStartUp>1</LoadOnStartUp>
  <UserUnloadable>1</UserUnloadable>
  <Hidden>0</Hidden>
  <SupportedSoftwareVersionGreaterThan>20..</SupportedSoftwareVersionGreaterThan>
  <DataVersion>1</DataVersion>
  <UserInterfaceVersion>1</UserInterfaceVersion>
</Addin>

and my activate() method

 Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate
            ' Initialiseer de Add-In members.
            g_inventorApplication = addInSiteObject.Application

            ' koppel met de uiEvents zodat je aan de ResetRibbon kan
            m_uiEvents = g_inventorApplication.UserInterfaceManager.UserInterfaceEvents

            ' Voor een button aan te maken moet je eerst een groot en een klein icon hebben dat je wil tonen. 
            ' Ook moet je de controlDefinitions  ophalen om de button te kunnen definieren.
            ' Als we dat gedaan hebben kunne we de button difiniëren met een naam, beschrijving en icons
            ' dit doen we voor de 3 buttons
            Dim POSGeeflargeIcon As stdole.IPictureDisp = PictureDispConverter.ToIPictureDisp(My.Resources.GetItemNrs32)
            Dim POSGeefsmallIcon As stdole.IPictureDisp = PictureDispConverter.ToIPictureDisp(My.Resources.GetItemNrs16)
            Dim POSGeefcontrolDefs As Inventor.ControlDefinitions = g_inventorApplication.CommandManager.ControlDefinitions
            m_POSGeefNrButton = POSGeefcontrolDefs.AddButtonDefinition("Geef POSNr", "Wijs POs nummers toe", CommandTypesEnum.kNonShapeEditCmdType, AddInClientID, "test", "test", POSGeefsmallIcon, POSGeeflargeIcon)

            Dim POSDeletelargeIcon As stdole.IPictureDisp = PictureDispConverter.ToIPictureDisp(My.Resources.GetItemNrs32)
            Dim POSDeletesmallIcon As stdole.IPictureDisp = PictureDispConverter.ToIPictureDisp(My.Resources.GetItemNrs16)
            Dim POSDeletecontrolDefs As Inventor.ControlDefinitions = g_inventorApplication.CommandManager.ControlDefinitions
            m_POSDeleteNrButton = POSDeletecontrolDefs.AddButtonDefinition("Delete POSNr", "Verwijder bestaande POS nummers", CommandTypesEnum.kNonShapeEditCmdType, AddInClientID, "test", "test", POSDeletesmallIcon, POSDeletelargeIcon)

            Dim COLlargeIcon As stdole.IPictureDisp = PictureDispConverter.ToIPictureDisp(My.Resources.COL32)
            Dim COLsmallIcon As stdole.IPictureDisp = PictureDispConverter.ToIPictureDisp(My.Resources.COL16)
            Dim COLcontrolDefs As Inventor.ControlDefinitions = g_inventorApplication.CommandManager.ControlDefinitions
            m_KleurCodeButton = COLcontrolDefs.AddButtonDefinition("KleurCode", "Wijs kleur aan parts en assemblies toe", CommandTypesEnum.kNonShapeEditCmdType, AddInClientID, "test", "test", COLsmallIcon, COLlargeIcon)

            ' Als de flag firstTime waar is zal de functie AddToUserInterface opgeroepen worden (altijd waar)
            If firstTime Then
                AddToUserInterface()
            End If
        End Sub
0 Likes