<?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: Replace with copy get idw in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5659581#M118147</link>
    <description>&lt;P&gt;This can definately be done and it's not too difficult really&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use a simple SaveAs Command to save and replace a component. You can use this code to get the part you have selected with the mouse&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oOccurrence&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt;


&lt;SPAN&gt;Try&lt;/SPAN&gt;
  &lt;SPAN&gt;oOccurrence&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Document&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;SelectSet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;Catch&lt;/SPAN&gt;
  &lt;SPAN&gt;MessageBox&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Show&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Please select a component before running this rule.&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;TKSY&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
  &lt;SPAN&gt;Return&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can open the drawing of the original part and then change the reference part with this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Documents&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ItemByName&lt;/SPAN&gt;&lt;SPAN&gt;(*Drawing Path*)&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;MsgBox(doc.DisplayName)&lt;/SPAN&gt;

&lt;SPAN&gt;oFD&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReferencedFileDescriptors&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DocumentDescriptor&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReferencedFileDescriptor&lt;/SPAN&gt;
&lt;SPAN&gt;oFD&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReplaceReference&lt;/SPAN&gt;&lt;SPAN&gt;(*New Part Path* &amp;amp; "&lt;/SPAN&gt;&lt;SPAN&gt;.ipt&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;doc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Update&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this points you in the right direction&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jun 2015 14:29:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-06-01T14:29:23Z</dc:date>
    <item>
      <title>Replace with copy + get idw</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5654627#M118141</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looking for an easy way to do a "point on part in assy - replace it with a copy - AND copying the idw".&lt;/P&gt;
&lt;P&gt;I have searched the internet thin with no result, but maybe the all knowing masses of Inventor forums has an idea or a link?&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 07:16:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5654627#M118141</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-28T07:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Replace with copy + get idw</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5655248#M118142</link>
      <description>&lt;P&gt;Point on a part?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Do you mean using something like the Pick method?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Copy?&lt;/P&gt;
&lt;P&gt;- Copy of what?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IDW?&lt;/P&gt;
&lt;P&gt;-Which idw? The one of the old part to be modified, or the one of the new part?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Details.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2015 15:04:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5655248#M118142</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2015-05-28T15:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Replace with copy + get idw</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5655797#M118143</link>
      <description>Tanks for your input. Let me try to explain it differently: With an open asm I would like to Select a part (or asm) with the mouse either from the model browser or directly in the window Then run the code The code should replace the selected part (or asm) with a copy that I can select the new name of eg. from an save as menu If there is already created a idw of the part (or asm) in the same dir as the original, the idw should be copied as well and referer to the new part. does it make more sense?</description>
      <pubDate>Thu, 28 May 2015 20:48:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5655797#M118143</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-28T20:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Replace with copy get idw</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5655823#M118144</link>
      <description>So when you select the part, you want to program to make a copy of it, put&lt;BR /&gt;that copy in a new folder directory, replace the part in the assembly, then&lt;BR /&gt;also move the idw to the new file directory?</description>
      <pubDate>Thu, 28 May 2015 21:05:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5655823#M118144</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2015-05-28T21:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Replace with copy get idw</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5656100#M118145</link>
      <description>Same directory, just new part/file number for both part and idw.</description>
      <pubDate>Fri, 29 May 2015 05:09:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5656100#M118145</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-29T05:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Replace with copy get idw</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5659493#M118146</link>
      <description>Sounds like one way you could do this is to just use the command manager to run the control definition for the Save And Replace feature on the part, but then also have a chunk of code in there that opens up your idw, replaces the model reference for the new part in there and saves it as a new idw.</description>
      <pubDate>Mon, 01 Jun 2015 13:51:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5659493#M118146</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2015-06-01T13:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Replace with copy get idw</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5659581#M118147</link>
      <description>&lt;P&gt;This can definately be done and it's not too difficult really&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use a simple SaveAs Command to save and replace a component. You can use this code to get the part you have selected with the mouse&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oOccurrence&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt;


&lt;SPAN&gt;Try&lt;/SPAN&gt;
  &lt;SPAN&gt;oOccurrence&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Document&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;SelectSet&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Item&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;Catch&lt;/SPAN&gt;
  &lt;SPAN&gt;MessageBox&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Show&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Please select a component before running this rule.&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;TKSY&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
  &lt;SPAN&gt;Return&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can open the drawing of the original part and then change the reference part with this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;doc&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Documents&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ItemByName&lt;/SPAN&gt;&lt;SPAN&gt;(*Drawing Path*)&lt;/SPAN&gt;

&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;MsgBox(doc.DisplayName)&lt;/SPAN&gt;

&lt;SPAN&gt;oFD&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReferencedFileDescriptors&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DocumentDescriptor&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReferencedFileDescriptor&lt;/SPAN&gt;
&lt;SPAN&gt;oFD&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ReplaceReference&lt;/SPAN&gt;&lt;SPAN&gt;(*New Part Path* &amp;amp; "&lt;/SPAN&gt;&lt;SPAN&gt;.ipt&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN&gt;doc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Update&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this points you in the right direction&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2015 14:29:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5659581#M118147</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-01T14:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Replace with copy get idw</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5663930#M118148</link>
      <description>Thanks for the suggestions. I will try to run some tests and post result if I get something useable.</description>
      <pubDate>Thu, 04 Jun 2015 07:50:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5663930#M118148</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-04T07:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Replace with copy get idw</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5911481#M118149</link>
      <description>&lt;P&gt;Try&amp;nbsp;&lt;A href="https://apps.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3areplacecopy_windows32and64%3aen" target="_blank"&gt;https://apps.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3areplacecopy_windows32and64%3aen&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 10:53:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/replace-with-copy-get-idw/m-p/5911481#M118149</guid>
      <dc:creator>Crstiano</dc:creator>
      <dc:date>2015-11-17T10:53:02Z</dc:date>
    </item>
  </channel>
</rss>

