Message 1 of 9
Add-in + Dockable Window
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
What am I missing here? It's creating the docked window, but not creating it's children.
So far all I have done is add a user control with some common controls on it and put this code in there:
Public Class UserControl1
Dim dc As UserControl1
Public Sub New(ByVal Application As Inventor.Application)
InitializeComponent()
Dim _InvApp As Inventor.Application
_InvApp = Application
Dim _ApplicationEvents As Inventor.ApplicationEvents
_ApplicationEvents = _InvApp.ApplicationEvents
Dim _UserInputEvents As Inventor.UserInputEvents
_UserInputEvents = _InvApp.CommandManager.UserInputEvents
' Add a event handlers to catch the user selection changes
AddHandler _ApplicationEvents.OnActivateDocument, AddressOf Document_Activated
AddHandler _UserInputEvents.OnSelect, AddressOf UserSelect
AddHandler _UserInputEvents.OnUnSelect, AddressOf UserUnSelect
Dim oUserInterfaceMgr As Inventor.UserInterfaceManager
oUserInterfaceMgr = _InvApp.UserInterfaceManager
Dim _Browser As Inventor.DockableWindow
_Browser = oUserInterfaceMgr.DockableWindows.Add("SampleClientId", "DDCIntName", "Ellimetal DDC")
_Browser.AddChild(CreateChildDialog())
_Browser.DockingState = Inventor.DockingStateEnum.kDockRight
_Browser.ShowTitleBar = True
_Browser.Visible = True
_Browser.Width = 220
End Sub
Public Function CreateChildDialog() As Long
If Not dc Is Nothing Then
dc.Dispose()
dc = Nothing
End If
dc = New UserControl1(g_inventorApplication)
dc.Show()
Return dc.Handle.ToInt64()
End Function
Private Sub Document_Activated()
Throw New NotImplementedException
End Sub
Private Sub UserSelect()
Throw New NotImplementedException
End Sub
Private Sub UserUnSelect()
Throw New NotImplementedException
End Sub
End Class
As well as adding this line into the StandardAddInServer.Vb under the Activate Method:
Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate
' Initialize AddIn members.
g_inventorApplication = addInSiteObject.Application
' Connect to the user-interface events to handle a ribbon reset.
m_uiEvents = g_inventorApplication.UserInterfaceManager.UserInterfaceEvents
Dim oBrowser As New UserControl1(g_inventorApplication)
I'm trying to take it one step at a time to get an idea of what I'm actually doing seeing as I have not made an add-in before.
Seems kind of overwhelming to start with all of extra lines of code in the project that I dont even need to look at, and not really having a clear idea of how it all works together...
Thanks in advance!
--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.
Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization

iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread
Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects
Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help
Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization
iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread
Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects
Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help
Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type