<?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: implementing Apprentice ClientView in c# in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3670054#M136261</link>
    <description>&lt;P&gt;The project that you added is working with Windows XP (x64) withAutodesk Inventor 2010.&lt;/P&gt;&lt;P&gt;But unfortunetely, dialog box become closed in Windows 7 (x64)&amp;nbsp;&lt;SPAN&gt;with Autodesk Inventor 2013&lt;/SPAN&gt;.&lt;BR /&gt;As I determined, dialog box become closed when it comes to the line &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&amp;nbsp;oClientView = oAppDoc.ClientViews.Add(pictureBox1.Handle.ToInt32());&amp;nbsp;" .&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Could you please help me about the solution of this issue.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Oct 2012 07:55:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-10-23T07:55:50Z</dc:date>
    <item>
      <title>implementing Apprentice ClientView in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3460420#M136253</link>
      <description>&lt;P&gt;I am trying to implement the Apprentice ClientView example in the Inventor API help file.&amp;nbsp; The code is given in Basic and I am using C# and I'm running into some problems. I think the issue is in the Form1_Load procedure in the line that sets the oClientView variable. I wasn't sure how to convert this to C#. Note that the original Basic code is in comments below the C# code.&amp;nbsp; When I run the program the oClientView.Camera object throws an exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public partial class Form1 : Form
    {
        ApprenticeServerComponent oSvr = new ApprenticeServerComponent();
        ApprenticeServerDocument oAppDoc;
        ClientView oClientView;

        public Form1()
        {
            InitializeComponent();
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            Camera oCamera = oClientView.Camera;
            oCamera.ViewOrientationType = ViewOrientationTypeEnum.kIsoBottomLeftViewOrientation;
            oCamera.Perspective = true;
            oCamera.Apply();
            this.Refresh();
            //Dim oCamera As Camera
            //Set oCamera = oClientView.Camera
            //oCamera.ViewOrientationType = kIsoBottomLeftViewOrientation
            //oCamera.Perspective = True
            //oCamera.Apply
            //Me.Refresh
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            string fileName = @"C:\Vault Workspace\Designs\Main\Blades\SB4000\Parts SBCT - 001-040.idw";
            ApprenticeServerComponent oSvr = new ApprenticeServerComponent();
            oAppDoc = oSvr.Open(fileName);
            oClientView = oAppDoc.ClientViews.Add(pictureBox1.Handle.ToInt32());
            //Dim filename As String
            //filename = "C:\Autodesk\Inventor 10\Tutorial Files\analyze-2.iam"
            //Set oSvr = New ApprenticeServerComponent
            //Set oAppDoc = oSvr.Open(filename)
            //Set oClientView = oAppDoc.ClientViews.Add(Picture1.hWnd)
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            oClientView.Update(false);
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2012 19:30:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3460420#M136253</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-16T19:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: implementing Apprentice ClientView in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3460722#M136254</link>
      <description>&lt;P&gt;I think the problem is that you've declared and are creating an instance of Apprentice in two places.&amp;nbsp; You create one as a member variable of the class and also one with the form load event.&amp;nbsp; You can completely remove the declaration from the form load event since you're declaring and creating the Apprentice instance when the form is created.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2012 23:43:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3460722#M136254</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2012-05-16T23:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: implementing Apprentice ClientView in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3460754#M136255</link>
      <description>&lt;P&gt;Yes, I should have caught that too.&amp;nbsp; All the objects seem to initialize properly now, but nothing shows up in the picturebox.&amp;nbsp; I have attached my files if you could look at it would be appreciated.&amp;nbsp; Thanks a lot for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2012 00:33:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3460754#M136255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-17T00:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: implementing Apprentice ClientView in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3462074#M136256</link>
      <description>&lt;P&gt;Attached is a test I put together.&amp;nbsp; It uses the mouse to allow you to rotate, zoom, and pan the view.&amp;nbsp; Depending on which mouse button is down you'll get one of the behaviors.&amp;nbsp; For drawings, you'll want the perspecitve to be false and you won't want to support rotating.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2012 18:16:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3462074#M136256</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2012-05-17T18:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: implementing Apprentice ClientView in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3463190#M136257</link>
      <description>&lt;P&gt;Thanks a lot, that is very helpful.&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2012 13:17:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3463190#M136257</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-18T13:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: implementing Apprentice ClientView in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3463264#M136258</link>
      <description>&lt;P&gt;I have added a bit more code now to support idws and also to browse for files to open.&amp;nbsp; However I am running into the same problem I had earlier that you submitted the change request for.&amp;nbsp; As soon as I try to open the second file, the program crashes. If I re-open the first file, everything's ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How soon can we expect to see a fix for this?&amp;nbsp; Is there any way we can work around it in the meantime?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lorne&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2012 13:53:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3463264#M136258</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-18T13:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: implementing Apprentice ClientView in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3464368#M136259</link>
      <description>&lt;P&gt;We're investigating a potential problem.&amp;nbsp; One question that will help is, are you using Apprentice through an Inventor View or an Inventor install?&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2012 22:54:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3464368#M136259</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2012-05-18T22:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: implementing Apprentice ClientView in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3464370#M136260</link>
      <description>I am using Inventor view only. The machine with this issue does not have a full Inventor install. Sent from my Blackberry</description>
      <pubDate>Fri, 18 May 2012 22:57:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3464370#M136260</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-18T22:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: implementing Apprentice ClientView in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3670054#M136261</link>
      <description>&lt;P&gt;The project that you added is working with Windows XP (x64) withAutodesk Inventor 2010.&lt;/P&gt;&lt;P&gt;But unfortunetely, dialog box become closed in Windows 7 (x64)&amp;nbsp;&lt;SPAN&gt;with Autodesk Inventor 2013&lt;/SPAN&gt;.&lt;BR /&gt;As I determined, dialog box become closed when it comes to the line &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&amp;nbsp;oClientView = oAppDoc.ClientViews.Add(pictureBox1.Handle.ToInt32());&amp;nbsp;" .&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Could you please help me about the solution of this issue.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2012 07:55:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3670054#M136261</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-23T07:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: implementing Apprentice ClientView in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3683900#M136262</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the code in message 4 Brian shared works well at my side (Inventor 2013 +SP1). Inventor View did had some issues. We have a SP1.1 . I cannot confirm if the problem you saw is relevant, but could you try with SP if it helps?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://usa.autodesk.com/adsk/servlet/pc/item?siteID=123112&amp;amp;id=20462274" target="_blank"&gt;http://usa.autodesk.com/adsk/servlet/pc/item?siteID=123112&amp;amp;id=20462274&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2012 06:34:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3683900#M136262</guid>
      <dc:creator>xiaodong_liang</dc:creator>
      <dc:date>2012-11-02T06:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: implementing Apprentice ClientView in c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3686334#M136263</link>
      <description>&lt;P&gt;I tried with SP1.1 and problem is solved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2012 08:05:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/implementing-apprentice-clientview-in-c/m-p/3686334#M136263</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-11-05T08:05:01Z</dc:date>
    </item>
  </channel>
</rss>

