<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help Creating a Button VB,NET Addin in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3804274#M131819</link>
    <description>&lt;P&gt;Okay, &amp;nbsp;Found "ZeroDoc" was the environment name I was looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything looks good on the QA toolbar as far as displaying my macros.&lt;/P&gt;&lt;P&gt;Except when I use the cusomize QA toolbar dropdown.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select some of my macros to be suppressed by unchecking them it doesn't stick.&lt;/P&gt;&lt;P&gt;Next time I load inventor all of them are back on the QA toolbar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How does one keep the customized display status?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2013 20:56:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-03-13T20:56:20Z</dc:date>
    <item>
      <title>Help Creating a Button VB,NET Addin</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3804077#M131817</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a need to write an Inventor addin that loads some macrobuttons to the quick access toolbar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I have it figured out as a test in VBA. No clue as to how to write it to be persistent as a VB.NET addin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I downloaded the 2013 Wizards and templates and have started a Inventor Addin for VB.NET&lt;BR /&gt;I've located the Region "ApplicationAddInServer Members" but need a nudge to get started.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help here?&lt;/P&gt;&lt;P&gt;--- Test VBA Code Follows ---&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Private Sub CommandButton1_Click()&lt;BR /&gt;&amp;nbsp; Dim myMacro As Inventor.MacroControlDefinition&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; 'Dim ZeroDocQAControls As Inventor.CommandControls&lt;BR /&gt;&amp;nbsp; Dim PrtQAControls As Inventor.CommandControls&lt;BR /&gt;&amp;nbsp; Dim AssyQAControls As Inventor.CommandControls&lt;BR /&gt;&amp;nbsp; Dim DwgQAControls As Inventor.CommandControls&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; 'Test macro to set in the quick launch toolbbar.&lt;BR /&gt;&amp;nbsp; Set myMacro = ThisApplication.CommandManager.ControlDefinitions.Item("macro:basLaunch.Dim_Power")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ' What is the Item name for zero document loaded. (NO Part,Assembly, or Drawing Environment)&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; 'Set ZeroDocQAControls = ThisApplication.UserInterfaceManager.Ribbons.Item("Zero Document").QuickAccessControls&lt;BR /&gt;&amp;nbsp; Set PrtQAControls = ThisApplication.UserInterfaceManager.Ribbons.Item("Part").QuickAccessControls&lt;BR /&gt;&amp;nbsp; Set AssyQAControls = ThisApplication.UserInterfaceManager.Ribbons.Item("Assembly").QuickAccessControls&lt;BR /&gt;&amp;nbsp; Set DwgQAControls = ThisApplication.UserInterfaceManager.Ribbons.Item("Drawing").QuickAccessControls&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ' Add Test macro to Quick Access Toolbars.&lt;BR /&gt;&amp;nbsp; 'Call ZeroDocQAControls.AddMacro(myMacro)&lt;BR /&gt;&amp;nbsp; Call PrtQAControls.AddMacro(myMacro)&lt;BR /&gt;&amp;nbsp; Call AssyQAControls.AddMacro(myMacro)&lt;BR /&gt;&amp;nbsp; Call DwgQAControls.AddMacro(myMacro)&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 17:52:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3804077#M131817</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-13T17:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help Creating a Button VB,NET Addin</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3804226#M131818</link>
      <description>&lt;P&gt;Okay, &amp;nbsp;I think I have it working in the Addin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A couple of questions though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) &amp;nbsp;Since I am not creating any new tabs or for that matter any new Macrodefinitions&lt;/P&gt;&lt;P&gt;Do I need to utilize the FirstTime argument or can I skip it and run my code on every launch?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) What is the Item name for the evironment that has no document loaded?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I am trying to use "Zero Document" but that fails.&lt;/P&gt;&lt;P&gt;ZeroDocQAControls = m_inventorApplication.UserInterfaceManager.Ribbons.Item("Zero Document").QuickAccessControls&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 20:08:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3804226#M131818</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-13T20:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help Creating a Button VB,NET Addin</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3804274#M131819</link>
      <description>&lt;P&gt;Okay, &amp;nbsp;Found "ZeroDoc" was the environment name I was looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything looks good on the QA toolbar as far as displaying my macros.&lt;/P&gt;&lt;P&gt;Except when I use the cusomize QA toolbar dropdown.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I select some of my macros to be suppressed by unchecking them it doesn't stick.&lt;/P&gt;&lt;P&gt;Next time I load inventor all of them are back on the QA toolbar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How does one keep the customized display status?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 20:56:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3804274#M131819</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-13T20:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help Creating a Button VB,NET Addin</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3806163#M131820</link>
      <description>&lt;P&gt;Since no one has responded I guess there is no built in way keep the changes the user makes to the visible state&lt;/P&gt;&lt;P&gt;of an item added to the quick access toolbar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Makes sense if they are being destroyed on Inventor shut down&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suppose I could use the deactivate event and save the visible/invisible state of my macros to disk&lt;/P&gt;&lt;P&gt;and restore them on activate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other Ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2013 19:10:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3806163#M131820</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-15T19:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help Creating a Button VB,NET Addin</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3806400#M131821</link>
      <description>&lt;P&gt;You should be able to query the Application.Documents.Count (something along those lines) to get the number of documents open (should be 0 if nothing is open), which could give you the logic conditions needed to load buttons. Then after that, if you load a document (On load event) you can have the button loadout change on the fly (maybe!).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Perhaps you should talk more in detail about what it is you're trying to accomplish. Though I recently started to get into the whole custom toolbar game myself, it might make for a fun adventure and help out some other people if we start a dialog about this now. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2013 01:37:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3806400#M131821</guid>
      <dc:creator>MegaJerk</dc:creator>
      <dc:date>2013-03-16T01:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help Creating a Button VB,NET Addin</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3807980#M131822</link>
      <description>&lt;P&gt;Since Inventor did away with toolbars, our engineers hate having to use multiple clicks to get at their custom macros.&lt;/P&gt;&lt;P&gt;As a workaround I am writing an addin that populate the quick access bar with macros in 2014.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The addin reads a text file that allows/ disallows which macro loads.&lt;/P&gt;&lt;P&gt;all works as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only piece of the puzzle I would like it persistence of the user controled visibliliy state.&lt;/P&gt;&lt;P&gt;Its not a show stopper. &amp;nbsp;we can live without it. &amp;nbsp;but it would be nice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--- Sampe of Text file ---&lt;/P&gt;&lt;P&gt;'...&lt;/P&gt;&lt;P&gt;&amp;nbsp;ZeroDoc : PG_To_PG&lt;/P&gt;&lt;P&gt;'...&lt;/P&gt;&lt;P&gt;Part : Dim_Power&lt;BR /&gt;Part : QuickDocs&lt;BR /&gt;' Part : PrepareDwgs&lt;BR /&gt;' Part : ExportDxf&lt;BR /&gt;' Part : PG_To_PG&lt;BR /&gt;' Part : ABS_Assy&lt;BR /&gt;' Part : Interfere&lt;BR /&gt;' Part : DimPrecision&lt;BR /&gt;Part : CreatePDF&lt;BR /&gt;Part : Swap_SheetMetal_Material&lt;BR /&gt;' Part : UpdateOldDrawing&lt;BR /&gt;Part : SimplifyPerfs&lt;/P&gt;&lt;P&gt;'...&lt;/P&gt;&lt;P&gt;Assembly : Dim_Power&lt;/P&gt;&lt;P&gt;'...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; line-height: 14px;"&gt;------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;#Region "ApplicationAddInServer Members"&lt;/P&gt;&lt;P&gt;&amp;nbsp; Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; line-height: 14px;"&gt;&amp;nbsp; ' This method is called by Inventor when it loads the AddIn.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ' The AddInSiteObject provides access to the Inventor Application object.&lt;BR /&gt;&amp;nbsp; ' The FirstTime flag indicates if the AddIn is loaded for the first time.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ' Initialize AddIn members. &amp;nbsp;&lt;BR /&gt;&amp;nbsp; m_inventorApplication = addInSiteObject.Application&lt;/P&gt;&lt;P&gt;&amp;nbsp; Dim ZeroDocQAControls As Inventor.CommandControls = m_inventorApplication.UserInterfaceManager.Ribbons.Item("ZeroDoc").QuickAccessControls&lt;BR /&gt;&amp;nbsp; Dim PrtQAControls As Inventor.CommandControls = m_inventorApplication.UserInterfaceManager.Ribbons.Item("Part").QuickAccessControls&lt;BR /&gt;&amp;nbsp; Dim AssyQAControls As Inventor.CommandControls = m_inventorApplication.UserInterfaceManager.Ribbons.Item("Assembly").QuickAccessControls&lt;BR /&gt;&amp;nbsp; Dim DwgQAControls As Inventor.CommandControls = m_inventorApplication.UserInterfaceManager.Ribbons.Item("Drawing").QuickAccessControls&lt;/P&gt;&lt;P&gt;&amp;nbsp; ' Add Test macro to Quick Access Toolbars.&lt;BR /&gt;&amp;nbsp; Dim sMacros() As String = IO.File.ReadAllLines("C:\Dim_Power\Local DB\PSPMacroBar.txt")&lt;/P&gt;&lt;P&gt;&amp;nbsp; For Each sMacro As String In sMacros&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If Not sMacro.Contains(":") Then sMacro = ""&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If sMacro.Trim.StartsWith("'") Then sMacro = ""&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If sMacro &amp;lt;&amp;gt; "" Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Dim sSeg() As String = sMacro.Split(":"c)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Dim sEnviron As String = sSeg(0).Trim.ToLower&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Dim sMacroName = sSeg(1).Trim&lt;BR /&gt;&amp;nbsp; &amp;nbsp; sMacroName = "macro:basLaunch." &amp;amp; sMacroName&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Dim myMacro As Inventor.MacroControlDefinition = CType(m_inventorApplication.CommandManager.ControlDefinitions.Item(sMacroName), MacroControlDefinition)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Select Case sEnviron&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Case "zerodoc"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ZeroDocQAControls.AddMacro(myMacro)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Case "part"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PrtQAControls.AddMacro(myMacro)&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Case "assembly"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; AssyQAControls.AddMacro(myMacro)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Case "drawing"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; DwgQAControls.AddMacro(myMacro)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; End Select&lt;BR /&gt;&amp;nbsp; End If&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;&amp;nbsp; ZeroDocQAControls = Nothing&lt;BR /&gt;&amp;nbsp; PrtQAControls = Nothing&lt;BR /&gt;&amp;nbsp; AssyQAControls = Nothing&lt;BR /&gt;&amp;nbsp; DwgQAControls = Nothing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;' TODO: Add ApplicationAddInServer.Activate implementation.&lt;BR /&gt;' e.g. event initialization, command creation etc.&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--- &amp;nbsp;Addin Activation ---&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2013 15:27:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/help-creating-a-button-vb-net-addin/m-p/3807980#M131822</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-18T15:27:36Z</dc:date>
    </item>
  </channel>
</rss>

