<?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 If statement between Part doc &amp;amp; Assembly doc in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/if-statement-between-part-doc-amp-assembly-doc/m-p/3186978#M138726</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to write my first VBA program for Inventor with very little programming experience.&amp;nbsp; I would like to create a userform which displays the materials list within a combobox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem I have is that I would like the userform to remain open no matter which type of file is active. I would like&amp;nbsp;the combobox to displayi the material list and current material when in a Part file and display N/A when in Assembly file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I figure it would probably be an if statement, but I don't know how to configure it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be gratefully appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Graeme&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inventor 2011 pro&lt;/P&gt;&lt;P&gt;Windows XP Pro 64 SP2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2011 10:11:57 GMT</pubDate>
    <dc:creator>gcooper79</dc:creator>
    <dc:date>2011-10-11T10:11:57Z</dc:date>
    <item>
      <title>If statement between Part doc &amp; Assembly doc</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/if-statement-between-part-doc-amp-assembly-doc/m-p/3186978#M138726</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to write my first VBA program for Inventor with very little programming experience.&amp;nbsp; I would like to create a userform which displays the materials list within a combobox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem I have is that I would like the userform to remain open no matter which type of file is active. I would like&amp;nbsp;the combobox to displayi the material list and current material when in a Part file and display N/A when in Assembly file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I figure it would probably be an if statement, but I don't know how to configure it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be gratefully appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Graeme&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inventor 2011 pro&lt;/P&gt;&lt;P&gt;Windows XP Pro 64 SP2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2011 10:11:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/if-statement-between-part-doc-amp-assembly-doc/m-p/3186978#M138726</guid>
      <dc:creator>gcooper79</dc:creator>
      <dc:date>2011-10-11T10:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: If statement between Part doc &amp; Assembly doc</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/if-statement-between-part-doc-amp-assembly-doc/m-p/3190038#M138727</link>
      <description>&lt;P&gt;HI, Graeme&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a Simple VBA code to use if statement for different operation between Part&amp;nbsp;&amp;amp; Assembly&lt;/P&gt;
&lt;P&gt;==================================================&lt;/P&gt;
&lt;P&gt;Sub SimpleCase()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dim&amp;nbsp;oDoc As Document&lt;BR /&gt;Set oDoc = ThisApplication.ActiveDocument&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If oDoc.DocumentType = kPartDocumentObject Then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;' the statement for Part &lt;BR /&gt;ElseIf oDoc.DocumentType = kAssemblyDocumentObject Then&lt;/P&gt;
&lt;P&gt;' the statement for Assembly&lt;/P&gt;
&lt;P&gt;End If&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;==================================================&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;let me know if it works for you&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Mick&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2011 07:14:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/if-statement-between-part-doc-amp-assembly-doc/m-p/3190038#M138727</guid>
      <dc:creator>xiaoyan.qi</dc:creator>
      <dc:date>2011-10-13T07:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: If statement between Part doc &amp; Assembly doc</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/if-statement-between-part-doc-amp-assembly-doc/m-p/3190080#M138728</link>
      <description>&lt;P&gt;Hi Mick,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply, It worked just as I hoped.&amp;nbsp; Now that the coding is complete, I would like to make it an Inventor&amp;nbsp;add-in.&amp;nbsp; The problem is I'm not sure how to achieve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using visual basic 2010 express, I was following Brian Ekins tutorial "taking the step from VBA to Inventor Add-ins"&amp;nbsp; but when I&amp;nbsp; try to debug the project, I get the following message&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"A project with an output type of class library cannot be started directly. In order to debug this project, add an executable project to this solution which references the libary project. Set the executable project as the startup project."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched the Internet for solutions, but the only ones I can find are for use with Visual Studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2011 07:52:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/if-statement-between-part-doc-amp-assembly-doc/m-p/3190080#M138728</guid>
      <dc:creator>gcooper79</dc:creator>
      <dc:date>2011-10-13T07:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: If statement between Part doc &amp; Assembly doc</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/if-statement-between-part-doc-amp-assembly-doc/m-p/3190204#M138730</link>
      <description>&lt;P&gt;in Visual studio, Menu Tools-&amp;gt; Attach to Process, select Inventor Application.&lt;/P&gt;
&lt;P&gt;then in Inventor, Load the add-in, work on your Add-in command, if there is error, add breakpoint on the statement to debug it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it's helpful&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Mick&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2011 10:47:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/if-statement-between-part-doc-amp-assembly-doc/m-p/3190204#M138730</guid>
      <dc:creator>xiaoyan.qi</dc:creator>
      <dc:date>2011-10-13T10:47:02Z</dc:date>
    </item>
  </channel>
</rss>

