Add-In unloaded

Add-In unloaded

Anonymous
Not applicable
494 Views
7 Replies
Message 1 of 8

Add-In unloaded

Anonymous
Not applicable
Add-in found unloaded when try to add new panel after some existing panel even i used the correct internal name of the existing panel. but if I remove the internal name of the existing panel the add-in found loaded and the new panel before the existing one. I tried with part ribbon Add-Ins tab, general tools tab and drawing tools tab.

renamePartControls.AddButton(oBtnFEdit, True, True, "{48A74AAC-E196-4AF0-9EC2-28C7C5150645}", False)

above code used target control internal name for the drawing tools panel in Add-Ins tab in part ribbon.

is there any other method to do the same correctly.

Thanks & Regards,
Saseendran Kombath
Interplast Co. Ltd.,
UAE
0 Likes
495 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
The argument expects the internal name of a control that you want to place
the new control next to. You'll need to specify the correct internal name of
the control (which is typically not a guid).

Sanjay-
0 Likes
Message 3 of 8

Anonymous
Not applicable
I'm not sure I fully understand your question. Have you stepped through
your code when the add-in is started to see what's happening? Very often
when there's a problem with the UI it's because there's a failure early in
the Activate method which causes the rest of the code after the Activate to
be skipped.
--
Brian Ekins
Autodesk Inventor API Product Designer
http://blogs.autodesk.com/modthemachine
0 Likes
Message 4 of 8

Anonymous
Not applicable
Below is the code I used for the Add-In I have installed another Add-In named SiPE on Add_Ins tab with a panel Named Sipe with internal name id_PanelP_Sipe.

After installing the below Add-In, if go to Add-In Manager inside inventor it shows Startup / Unloaded. if I tick the Startup Load the Add_In Loads and the tab will appear on the correct position for that session. This is only if I provide the target internal name. If it is not supplied the Add-In Loads perfectly but the panel will be the first on that tab.

Thanks & Regards,
Saseendran Kombath
Interplast Co. Ltd.,
UAE

{code}
Imports Inventor
Imports System.Runtime.InteropServices
Imports Microsoft.Win32

Namespace RenameFeature
GuidAttribute("3f174f39-e63a-4ce3-979b-d99e8d87a12a")> _

Public Class StandardAddInServer
Implements Inventor.ApplicationAddInServer
Private m_AddInCLSIDString As String
Private WithEvents dlgFRename As frmLabelRename = Nothing
Private WithEvents oBtnFEdit As Inventor.ButtonDefinition
Private Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As Int32, ByVal hWndNewParent As Int32) As Int32

#Region "ApplicationAddInServer Members"

Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate

' This method is called by Inventor when it loads the AddIn.
' The AddInSiteObject provides access to the Inventor Application object.
' The FirstTime flag indicates if the AddIn is loaded for the first time.

' Initialize AddIn members.
m_inventorApplication = addInSiteObject.Application
Dim addInCLSID As GuidAttribute
addInCLSID = CType(System.Attribute.GetCustomAttribute(GetType(RenameFeature.StandardAddInServer), GetType(GuidAttribute)), GuidAttribute)

m_AddInCLSIDString = "{" & addInCLSID.Value & "}"

Try : oBtnFEdit = CreateButton("Edit" & vbCrLf & "Feature Label", "IP:intCmd:FEdit", _
Inventor.CommandTypesEnum.kNonShapeEditCmdType, True, m_AddInCLSIDString, "Edit Feature Label", _
"Edit Feature Label", "RenameFeature.Edit_24.ico", "RenameFeature.Edit_48.ico", _
Inventor.ButtonDisplayEnum.kDisplayTextInLearningMode) : Catch : End Try

Dim userInterfaceMgr As UserInterfaceManager
userInterfaceMgr = m_inventorApplication.UserInterfaceManager

If firstTime Then
'Get the ribbons associated with part envornment
Dim partRibbon As Ribbon = userInterfaceMgr.Ribbons("Part")

'Get the Addinns tab associated with respective Ribbons
Dim partAddinTab As RibbonTab = partRibbon.RibbonTabs("id_AddInsTab")

'Create Rename Panel on Addins Tab next to Sipe Panel
Dim partRenamePanel As RibbonPanel = partAddinTab.RibbonPanels.Add("Rename", "id_PanelP_Rename", m_AddInCLSIDString, "id_PanelP_Sipe", False)

'Get command controls and add button to it
Dim renamePartControls As CommandControls = partRenamePanel.CommandControls

renamePartControls.AddButton(oBtnFEdit, True, True, , )

End If
' TODO: Add ApplicationAddInServer.Activate implementation.
' e.g. event initialization, command creation etc.

End Sub
{code}

Edited by: saseendrankombath on Jul 24, 2009 5:08 AM

Edited by: saseendrankombath on Jul 24, 2009 5:08 AM Edited by: saseendrankombath on Jul 24, 2009 5:09 AM
0 Likes
Message 5 of 8

Anonymous
Not applicable
Thanks Sanjay,
this is the internal name of Drawing tools supplied by autodesk Edited by: saseendrankombath on Jul 24, 2009 5:07 AM
0 Likes
Message 6 of 8

Anonymous
Not applicable
"{48A74AAC-E196-4AF0-9EC2-28C7C5150645}" is the internal name of the ribbon
panel. The method expects the internal name of a control within the panel,
before or after which to place the new control.

Sanjay-
0 Likes
Message 7 of 8

Anonymous
Not applicable
Also, as discussed in the other thread regarding this, your code assumes
that the drawing tools Add-in loads before your Add-in, which may not be the
case. Creating your own panel for your commands seems to be the best option.

Sanjay-
0 Likes
Message 8 of 8

Anonymous
Not applicable
Thanks Sanjay
Now I am doing it with out referring to other panels. let the new one to take its on position.

Thanks & regards,
Saseendran Kombath
Interplast Co. Ltd.,
UAE
0 Likes