Hickoz_bro Posted July 25, 2011 Posted July 25, 2011 Hi all, I've finally decided to take the plunge and give add-ins a go, but so far it's not going well. I've surrounded myself with printouts from Mr Ekins, poured over the SDK sample add-ins and scoured the discussion forums, but I've come up with naught... The Code i've got is shown below (albeit a bit truncated). I'm pretty sure that the error is with the arguments for 'AddButtonDefinition', but I can't figure it out, it matches one of the Samples perfectly (where it matters). Private m_inventorApplication As Inventor.Application Private m_ClientID As String Private WithEvents oButtonActivate As Inventor.ButtonDefinition Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate Try oButtonActivate = m_inventorApplication.CommandManager.ControlDefinitions.AddButtonDefinition( _ "HDAL Label Maker", "ActivateHDALLabelMaker", CommandTypesEnum.kShapeEditCmdType, _ m_ClientID, "Activates the HDAL Label Maker.", "HDAL Label Maker", icoHDALLabelMaker16x16, _ icoHDALLabelMaker32x32) Catch ex As Exception MsgBox(ex.ToString & vbCrLf & m_ClientID) End Try (Sorry about the formatting) I've attached an image of the error thrown by 'Catch ex as Exception' incase it offers any clues... Any assistance would be greatly appreciated. I've spent WAY too much time trying to figure this one out... Cheers Quote
shirazbj Posted July 26, 2011 Posted July 26, 2011 Hi Gerrard, I am trying to write an AddIn with VB express 2010 for Inventor 2012 on Win7 64. I am following Ekins's "How to write an Inventor Add-In" paper (http://modthemachine.typepad.com/files/VBAtoAddIn.pdf) That paper is for 2010. It is a little different from 2012. I managed to build the Add-In and could list it in Inventor, still working on how to run the Add_in now. Which version of vb.net & Inventor are you using. Regards, Cean_au shirazbj@hotmail.com Quote
BlackBox Posted July 26, 2011 Posted July 26, 2011 This thread should be moved to the .NET, ObjectARX & VBA forum. I am unfamiliar with Inventor, but let me know if you need assistance with getting Visual Studio 2010 Express to debug, and step through breakpoints in your code. Quote
Hickoz_bro Posted July 27, 2011 Author Posted July 27, 2011 Shirazbj - Yeah, I've been working to that, and other documents by Brian and others... They're all very helpful, but none answer my specific question. Have you managed to get Icons to display on your add-in? If so, how did you go about it? I'm using Inventor 2012, and Visual Studio 2008. Renderman - I did see that forum, but it says AutoCAD Customisation, so I figured I might get more responses if I posted in the Inventor Forum.. Either way, I don't mind if a mod wants to move it. Cheers Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.