<?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: Powermill api, plugin gets stuck on UseExistingInstance in PowerShape and PowerMill API Forum</title>
    <link>https://forums.autodesk.com/t5/powershape-and-powermill-api/powermill-api-plugin-gets-stuck-on-useexistinginstance/m-p/11196873#M435</link>
    <description>Thanks,&lt;BR /&gt;indeed all data needed was already there, and no need to do "new pmautomation..."&lt;BR /&gt;&lt;BR /&gt;Thanks again</description>
    <pubDate>Fri, 27 May 2022 07:13:51 GMT</pubDate>
    <dc:creator>adrian.motea</dc:creator>
    <dc:date>2022-05-27T07:13:51Z</dc:date>
    <item>
      <title>Powermill api, plugin gets stuck on UseExistingInstance</title>
      <link>https://forums.autodesk.com/t5/powershape-and-powermill-api/powermill-api-plugin-gets-stuck-on-useexistinginstance/m-p/11184047#M433</link>
      <description>&lt;P&gt;Hi, i noticed a problem with all my plugins made in vb.net using windows forms.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i have a pmill running that is making a toolpath calculation, and i open another pmill,&lt;/P&gt;&lt;P&gt;the code gets stuck at this line&lt;/P&gt;&lt;P&gt;PMillInstance = New PMAutomation(Autodesk.ProductInterface.InstanceReuse.UseExistingInstance)&lt;/P&gt;&lt;P&gt;and it doesn't proceed until the first pmill finishes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same thing happens also when i try to enable the plugin, it just get stuck with execution on the same line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code is inside the initialise sub&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Sub Initialise(Token As String, pServices As PowerMILL.PluginServices, ParentWindow As Integer) Implements PowerMILL.IPowerMILLPlugin.Initialise&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;PMillInstance = New PMAutomation(Autodesk.ProductInterface.InstanceReuse.UseExistingInstance)&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;anyone has any idea why this might happen ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2022 10:13:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powershape-and-powermill-api/powermill-api-plugin-gets-stuck-on-useexistinginstance/m-p/11184047#M433</guid>
      <dc:creator>adrian.motea</dc:creator>
      <dc:date>2022-05-21T10:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Powermill api, plugin gets stuck on UseExistingInstance</title>
      <link>https://forums.autodesk.com/t5/powershape-and-powermill-api/powermill-api-plugin-gets-stuck-on-useexistinginstance/m-p/11184782#M434</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Your code looks like you already got&amp;nbsp;&lt;SPAN&gt;pServices from Plugin Framework. Then I think you don't need to initialize&amp;nbsp;PMAutomation from API.&lt;BR /&gt;Actually, PMillInstance = New PMAutomation(Autodesk.ProductInterface.InstanceReuse.UseExistingInstance) doesn't differentiate between instances of PMs so you could have pServices from the correct one and the PMAutomation from the other.&amp;nbsp;&lt;BR /&gt;From the code (open source in the internet) the New PMAutomation(Autodesk.ProductInterface.InstanceReuse.UseExistingInstance)&amp;nbsp; is just using Marshal.GetActiveObject(CLASS_ID) where the&amp;nbsp;CLASS_ID is&amp;nbsp; "PowerMILL.Application". In this case, you will just get the first instance of the Powermill which was run first.&amp;nbsp;&lt;BR /&gt;If you want to connect to the correct instance, look at the&amp;nbsp;&amp;nbsp;New PMAutomation(powerMillComObject).&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2022 23:15:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powershape-and-powermill-api/powermill-api-plugin-gets-stuck-on-useexistinginstance/m-p/11184782#M434</guid>
      <dc:creator>ondrej.mikulec</dc:creator>
      <dc:date>2022-05-21T23:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Powermill api, plugin gets stuck on UseExistingInstance</title>
      <link>https://forums.autodesk.com/t5/powershape-and-powermill-api/powermill-api-plugin-gets-stuck-on-useexistinginstance/m-p/11196873#M435</link>
      <description>Thanks,&lt;BR /&gt;indeed all data needed was already there, and no need to do "new pmautomation..."&lt;BR /&gt;&lt;BR /&gt;Thanks again</description>
      <pubDate>Fri, 27 May 2022 07:13:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powershape-and-powermill-api/powermill-api-plugin-gets-stuck-on-useexistinginstance/m-p/11196873#M435</guid>
      <dc:creator>adrian.motea</dc:creator>
      <dc:date>2022-05-27T07:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Powermill api, plugin gets stuck on UseExistingInstance</title>
      <link>https://forums.autodesk.com/t5/powershape-and-powermill-api/powermill-api-plugin-gets-stuck-on-useexistinginstance/m-p/12233510#M436</link>
      <description>&lt;P&gt;Do you have any sample with this code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;New PMAutomation(powerMillComObject)&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 02:36:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powershape-and-powermill-api/powermill-api-plugin-gets-stuck-on-useexistinginstance/m-p/12233510#M436</guid>
      <dc:creator>nguyenthinhvt95</dc:creator>
      <dc:date>2023-09-12T02:36:05Z</dc:date>
    </item>
  </channel>
</rss>

