<?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 c# insert ipt in assembly - user interaction in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-insert-ipt-in-assembly-user-interaction/m-p/6543765#M66602</link>
    <description>&lt;P&gt;Good morning everyone,&lt;BR /&gt;i'm rewriting in c# some of my very old tools written years ago in vba.&lt;/P&gt;&lt;P&gt;(Doing that using Inventor 2017 and visual studio 2015 )&lt;/P&gt;&lt;P&gt;I'm going quite well with the rewriting but i'm locked with inserting an ipt into an assembly giving to the user the opportunity to choose the displacing point.&lt;BR /&gt;(I can add component by adding it to the assembly document ComponentOccurrences, but no user interaction)&lt;/P&gt;&lt;P&gt;In Vba, the way that i used was calling Command manager like this:&lt;BR /&gt;Call ThisApplication.CommandManager.PostPrivateEvent(kFileNameEvent, sFile)&lt;BR /&gt;Call ThisApplication.CommandManager.StartCommand(kPlaceComponentCommand)&lt;/P&gt;&lt;P&gt;now i'm doing this:&lt;BR /&gt;m_InventorApplication.CommandManager.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent, sFile);&lt;BR /&gt;I can't find in CommandManager something that can replace the StartCommand.&lt;BR /&gt;I see in the api doc that there is a CreateDragContext as CommandManager method&lt;/P&gt;&lt;P&gt;I want to ask if:&lt;BR /&gt;-anybody knows if however is the right way to give to the user the control of where to place the new component in the assembly&lt;BR /&gt;-anybody knows how to do that in c#&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you in advance&lt;/P&gt;&lt;P&gt;Christian&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2016 08:26:29 GMT</pubDate>
    <dc:creator>Christian_1976</dc:creator>
    <dc:date>2016-09-06T08:26:29Z</dc:date>
    <item>
      <title>c# insert ipt in assembly - user interaction</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-insert-ipt-in-assembly-user-interaction/m-p/6543765#M66602</link>
      <description>&lt;P&gt;Good morning everyone,&lt;BR /&gt;i'm rewriting in c# some of my very old tools written years ago in vba.&lt;/P&gt;&lt;P&gt;(Doing that using Inventor 2017 and visual studio 2015 )&lt;/P&gt;&lt;P&gt;I'm going quite well with the rewriting but i'm locked with inserting an ipt into an assembly giving to the user the opportunity to choose the displacing point.&lt;BR /&gt;(I can add component by adding it to the assembly document ComponentOccurrences, but no user interaction)&lt;/P&gt;&lt;P&gt;In Vba, the way that i used was calling Command manager like this:&lt;BR /&gt;Call ThisApplication.CommandManager.PostPrivateEvent(kFileNameEvent, sFile)&lt;BR /&gt;Call ThisApplication.CommandManager.StartCommand(kPlaceComponentCommand)&lt;/P&gt;&lt;P&gt;now i'm doing this:&lt;BR /&gt;m_InventorApplication.CommandManager.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent, sFile);&lt;BR /&gt;I can't find in CommandManager something that can replace the StartCommand.&lt;BR /&gt;I see in the api doc that there is a CreateDragContext as CommandManager method&lt;/P&gt;&lt;P&gt;I want to ask if:&lt;BR /&gt;-anybody knows if however is the right way to give to the user the control of where to place the new component in the assembly&lt;BR /&gt;-anybody knows how to do that in c#&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you in advance&lt;/P&gt;&lt;P&gt;Christian&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 08:26:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-insert-ipt-in-assembly-user-interaction/m-p/6543765#M66602</guid>
      <dc:creator>Christian_1976</dc:creator>
      <dc:date>2016-09-06T08:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: c# insert ipt in assembly - user interaction</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-insert-ipt-in-assembly-user-interaction/m-p/6560623#M66786</link>
      <description>&lt;P&gt;What you've run into isn't a change from VBA to C# but is a change that was made in the API quite a while ago.&amp;nbsp; The StartCommand method has been retired.&amp;nbsp; You can still accomplish the same thing by first getting the CommandDefinition that represents the command and then executing it.&amp;nbsp; Below os some sample code that demonstrates what you're trying to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;string filename = "C:/Temp/Tests/EllipsePart.ipt";

// Post the filename to the private event queue. 
invApp.CommandManager.PostPrivateEvent(Inventor.PrivateEventTypeEnum.kFileNameEvent, filename);

// Get the control definition for the Place Component command.
Inventor.ControlDefinition ctrlDef = invApp.CommandManager.ControlDefinitions["AssemblyPlaceComponentCmd"];

// Execute the command. 
ctrlDef.Execute();
&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2016 01:21:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-insert-ipt-in-assembly-user-interaction/m-p/6560623#M66786</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2016-09-14T01:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: c# insert ipt in assembly - user interaction</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-insert-ipt-in-assembly-user-interaction/m-p/7306934#M74291</link>
      <description>&lt;P&gt;I'm deeply sorry to answer you only now, after a so long time, but i had to stop suddenly my task and i'm now review it all.&lt;/P&gt;&lt;P&gt;Your solution works, thank you a lot.&lt;/P&gt;&lt;P&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 06:48:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-insert-ipt-in-assembly-user-interaction/m-p/7306934#M74291</guid>
      <dc:creator>Christian_1976</dc:creator>
      <dc:date>2017-08-17T06:48:51Z</dc:date>
    </item>
  </channel>
</rss>

