<?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 how to addin a user-defined form in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-addin-a-user-defined-form/m-p/759995#M169175</link>
    <description>I have successfully addin a icon in Inventor 7, and I define a form. I want&lt;BR /&gt;
to click the icon to run the form. When I click the icon, there is a error&lt;BR /&gt;
that undefined object or with block.&lt;BR /&gt;
My code is:&lt;BR /&gt;
&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
Implements ApplicationAddInServer&lt;BR /&gt;
Public oApp As Inventor.Application&lt;BR /&gt;
Public WithEvents oButtonHandler1 As ButtonDefinitionHandler&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
......&lt;BR /&gt;
&lt;BR /&gt;
Private Sub oButtonHandler1_OnClick()&lt;BR /&gt;
   'my defined form&lt;BR /&gt;
&lt;BR /&gt;
   Dia_Pbom.Show&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
    <pubDate>Tue, 26 Aug 2003 17:40:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2003-08-26T17:40:11Z</dc:date>
    <item>
      <title>how to addin a user-defined form</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-addin-a-user-defined-form/m-p/759995#M169175</link>
      <description>I have successfully addin a icon in Inventor 7, and I define a form. I want&lt;BR /&gt;
to click the icon to run the form. When I click the icon, there is a error&lt;BR /&gt;
that undefined object or with block.&lt;BR /&gt;
My code is:&lt;BR /&gt;
&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
Implements ApplicationAddInServer&lt;BR /&gt;
Public oApp As Inventor.Application&lt;BR /&gt;
Public WithEvents oButtonHandler1 As ButtonDefinitionHandler&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
......&lt;BR /&gt;
&lt;BR /&gt;
Private Sub oButtonHandler1_OnClick()&lt;BR /&gt;
   'my defined form&lt;BR /&gt;
&lt;BR /&gt;
   Dia_Pbom.Show&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
      <pubDate>Tue, 26 Aug 2003 17:40:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-addin-a-user-defined-form/m-p/759995#M169175</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-08-26T17:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to addin a user-defined form</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-addin-a-user-defined-form/m-p/759996#M169176</link>
      <description>You might need to create the form as a new form first before showing it:&lt;BR /&gt;
&lt;BR /&gt;
dim aForm as new Form1&lt;BR /&gt;
&lt;BR /&gt;
    aForm.show&lt;BR /&gt;
&lt;BR /&gt;
Hope this helps, can't remember whether you need the "new" statement or not,&lt;BR /&gt;
but from memory this should work.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"zhao ting" &lt;PZHAOTING&gt; wrote in message&lt;BR /&gt;
news:968700A9402FF67DF5704EA90BDD843E@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; I have successfully addin a icon in Inventor 7, and I define a form. I&lt;BR /&gt;
want&lt;BR /&gt;
&amp;gt; to click the icon to run the form. When I click the icon, there is a error&lt;BR /&gt;
&amp;gt; that undefined object or with block.&lt;BR /&gt;
&amp;gt; My code is:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Option Explicit&lt;BR /&gt;
&amp;gt; Implements ApplicationAddInServer&lt;BR /&gt;
&amp;gt; Public oApp As Inventor.Application&lt;BR /&gt;
&amp;gt; Public WithEvents oButtonHandler1 As ButtonDefinitionHandler&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; ......&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Private Sub oButtonHandler1_OnClick()&lt;BR /&gt;
&amp;gt;    'my defined form&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;    Dia_Pbom.Show&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/PZHAOTING&gt;</description>
      <pubDate>Wed, 27 Aug 2003 01:16:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-addin-a-user-defined-form/m-p/759996#M169176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-08-27T01:16:11Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-addin-a-user-defined-form/m-p/759997#M169177</link>
      <description>J Smith&lt;BR /&gt;
I am a novice in VB, thank you for your help!&lt;BR /&gt;
Now I can do the initialization of the form1 in my class module. As follow&lt;BR /&gt;
code.&lt;BR /&gt;
&lt;BR /&gt;
Public Sub oButtonHandler1_OnClick()&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  form1.daihao = oApp.ActiveDocument.PropertySets.Item(3).Item("Part&lt;BR /&gt;
Number").Value&lt;BR /&gt;
  form1.xinghao =&lt;BR /&gt;
oApp.ActiveDocument.PropertySets.Item(1).Item("Keywords").Value&lt;BR /&gt;
  form1.mingcheng =&lt;BR /&gt;
oApp.ActiveDocument.PropertySets.Item(3).Item("Description").Value&lt;BR /&gt;
&lt;BR /&gt;
  form1.Show&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
  There is the error if I click command1 button, even though I do it as your&lt;BR /&gt;
advice.&lt;BR /&gt;
&lt;BR /&gt;
zhao ting&lt;BR /&gt;
&lt;BR /&gt;
"" &lt;NOSPAM&gt; ????&lt;BR /&gt;
news:1E8A00A3B115A5F823C336F4D79B18D2@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; You might need to create the form as a new form first before showing it:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; dim aForm as new Form1&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     aForm.show&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Hope this helps, can't remember whether you need the "new" statement or&lt;BR /&gt;
not,&lt;BR /&gt;
&amp;gt; but from memory this should work.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "zhao ting" &lt;PZHAOTING&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:968700A9402FF67DF5704EA90BDD843E@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; I have successfully addin a icon in Inventor 7, and I define a form. I&lt;BR /&gt;
&amp;gt; want&lt;BR /&gt;
&amp;gt; &amp;gt; to click the icon to run the form. When I click the icon, there is a&lt;BR /&gt;
error&lt;BR /&gt;
&amp;gt; &amp;gt; that undefined object or with block.&lt;BR /&gt;
&amp;gt; &amp;gt; My code is:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Option Explicit&lt;BR /&gt;
&amp;gt; &amp;gt; Implements ApplicationAddInServer&lt;BR /&gt;
&amp;gt; &amp;gt; Public oApp As Inventor.Application&lt;BR /&gt;
&amp;gt; &amp;gt; Public WithEvents oButtonHandler1 As ButtonDefinitionHandler&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; ......&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Private Sub oButtonHandler1_OnClick()&lt;BR /&gt;
&amp;gt; &amp;gt;    'my defined form&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;    Dia_Pbom.Show&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; End Sub&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/PZHAOTING&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Wed, 27 Aug 2003 18:54:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/how-to-addin-a-user-defined-form/m-p/759997#M169177</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2003-08-27T18:54:38Z</dc:date>
    </item>
  </channel>
</rss>

