Good Add-in Tutorial

Good Add-in Tutorial

Anonymous
Not applicable
2,268 Views
8 Replies
Message 1 of 9

Good Add-in Tutorial

Anonymous
Not applicable

Hello, I am looking for a good add in tutorial.. all I was able to find so far is for old versions (around 2010) and the whole visual studio template looks different than the current one. 

 

Note, i am looking for the inventor Add in dll, not the stand alone exe/plugin. As i already completed that.. but i would like to make add ins that are dockable and load with inventor.

 

thank you!

0 Likes
2,269 Views
8 Replies
Replies (8)
Message 2 of 9

etaCAD
Advocate
Advocate
0 Likes
Message 3 of 9

Anonymous
Not applicable

Thanks, but as mentioned i already went through this tutorial. This is a plug in tutorial that creates an external indipendent exe file. I need a tutorial that explains how to create an add in dll loaded and started by inventor with a dockable window.

0 Likes
Message 4 of 9

etaCAD
Advocate
Advocate

Sorry,

 

Did you already had a look in  your SDK folder : c:\Users\Public\Documents\Autodesk\Inventor xxxx\SDK\DeveloperTools\Samples\VB.NET\AddIns\

 

You can also read the paper here and skip the registry part.

Something about the Ribbon: http://modthemachine.typepad.com/my_weblog/2010/01/upgrading-your-add-ins-to-support-the-ribbon-user...

 

And don't forget Inventor's programming help.

 

Regarding dockable windows have a look at jeff.pek's example

Andreas
etaCAD

0 Likes
Message 5 of 9

Anonymous
Not applicable

Thanks! ribbon is working ok now, but the sample you postet is outdated and not compatible with the curent visual studio edition. What iw ould need now is to understand how to display a form that i made with the form designer (putting form1.show() in the activate sub does not work, it says reference to a non shared member requires an object reference) and then how to convert this form to a dockable form.

 

thank you!

0 Likes
Message 6 of 9

etaCAD
Advocate
Advocate

It is diffucult to see what is wrong without your code.

 

Your error comes up because you didn't create an instance of the oject form1. You need Dim myFrm as new form1

 

 

Here are some snippets

 

 

Private dwCalcualtor As Inventor.DockableWindow ' global
...
Try
            Dim uiMan As UserInterfaceManager = inventorApplication.UserInterfaceManager
                Try ' Calculator
                    dwCalcualtor = uiMan.DockableWindows.Item("BT_Calculator")
                    dwCalcualtor.Delete()
                    dwCalcualtor = uiMan.DockableWindows.Add(AddinGlobal.ClassId, "BT_Calculator", "Calculator")
                    dwCalcualtor.AddChild(CreateCalculatorDialog())
                Catch ex As Exception
                    dwCalcualtor = uiMan.DockableWindows.Add(AddinGlobal.ClassId, "BT_Calculator", "Calculator")
                    dwCalcualtor.AddChild(CreateCalculatorDialog())
                Finally
                  dwCalcualtor.DisabledDockingStates = Inventor.DockingStateEnum.kDockTop 
                  dwCalcualtor.DockingState = DockingStateEnum.kDockLastKnown
                  dwCalcualtor.ShowVisibilityCheckBox = True
                  dwCalcualtor.ShowTitleBar = True
                  dwCalcualtor.SetMinimumSize(350, 215)
                  dwCalcualtor.Visible = True
                End Try
Catch ex As Exception
End Try

 Private Function CreateCalculatorDialog() As Long

            m_dwCalculator = New dwCalculator
            m_dwCalculator.Show()
            Return m_dwCalculator.Handle.ToInt64()

End Function

 

Andreas
etaCAD

0 Likes
Message 7 of 9

Anonymous
Not applicable

Thank you andreas, meanwhile I managed to make a dockable form, but for some reason its not displaying the button i placed there.. i just placed a simple button, but the form (usercontrol) is simple empty once it gets loaded in inventor...

 

 

 

i call this on activation:

 

 

  Private Sub CreateDockableWindow()

            ' Set reference to the user interface manager
            Dim oUserInterfaceMgr As UserInterfaceManager
            oUserInterfaceMgr = g_inventorApplication.UserInterfaceManager

            ' Create a new dockable window
            Dim oWindow As DockableWindow
            oWindow = oUserInterfaceMgr.DockableWindows.Add("SampleClientId", "TestWindowInternalName", "Test Window")

            Dim oForm As New UserControl1
            oWindow.AddChild(oForm.Handle)

            ' Dock the window to the right
            oWindow.DisabledDockingStates = Inventor.DockingStateEnum.kDockTop
            oWindow.DockingState = DockingStateEnum.kDockLastKnown
            oWindow.ShowVisibilityCheckBox = True
            oWindow.ShowTitleBar = True
            oWindow.SetMinimumSize(350, 215)
            oWindow.Visible = True
        End Sub

 

0 Likes
Message 8 of 9

Martin-Winkler-Consulting
Advisor
Advisor

Hi @Anonymous

may be this post can help you.

https://forums.autodesk.com/t5/inventor-customization/looking-for-sample-c-addin-with-button-added-to-a-ribbon-panel/td-p/7345471

Martin Winkler
CAD Developer
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

0 Likes
Message 9 of 9

Anonymous
Not applicable

Hello guys, I am a beginner in connecting Inventory with the application (asp.net). Is there an example (video tutorial) on how to connect Inventor to an application #c # or someone else?

0 Likes