<?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: Redefine Extrude Sketch in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/redefine-extrude-sketch/m-p/13023948#M171837</link>
    <description>&lt;P&gt;It does seem like I have seen this done before.&amp;nbsp; It should be possible because the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ExtrudeFeature_Definition" target="_blank" rel="noopener"&gt;ExtrudeFeature.Definition&lt;/A&gt;&amp;nbsp;property is Read/Write, meaning we can set a different&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-ExtrudeDefinition" target="_blank" rel="noopener"&gt;ExtrudeDefinition&lt;/A&gt;&amp;nbsp;as its value.&amp;nbsp; Possible steps might be to get a '&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ExtrudeDefinition_Copy" target="_blank" rel="noopener"&gt;Copy&lt;/A&gt;' of the existing ExtrudeDefinition to a variable, then use the definition's available 'Set' methods to change it as needed, then set that copy of the definition back as the new value of ExtrudeFeature.Definition property.&amp;nbsp; May need to do so in silent operation though, not sure.&amp;nbsp; I have not tried it recently.&amp;nbsp;&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ExtrudeDefinition_Profile" target="_blank" rel="noopener"&gt;ExtrudeDefinition.Profile&lt;/A&gt;&amp;nbsp;property is Read/Write also, but I would only do that on the copied version of the definition, then set the definition as new definition, instead of trying to do it directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; I may have been wrong about what I remembered being possible.&amp;nbsp; I did a little local testing within a test part, and I can easily change the extents of an existing extrude feature, and can potentially change between profiles within the same sketch that the extrude feature is already pointing to, when there are multiple profiles within that same sketch.&amp;nbsp; But getting an existing extrude feature to switch to using a completely different sketch is something I have not been able to do during my initial recent testing.&amp;nbsp; I know that when using BRep references for changing extent related details, we must move end of part to before feature, then back after feature, but that should not be needed for sketch profile change, so I am not sure why it is not allowing this.&amp;nbsp; Maybe something we have to ask the folks at Autodesk about.&amp;nbsp; This has to be something that has been asked about before, because it seems very familiar.&amp;nbsp; But I lost a lot of my code snippets a while back, which contained not only code examples, but links to important/informational discussions like that.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 17:32:26 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2024-09-16T17:32:26Z</dc:date>
    <item>
      <title>Redefine Extrude Sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/redefine-extrude-sketch/m-p/13023313#M171817</link>
      <description>&lt;P&gt;Is there a possibility via the API to change a specific "Extrusion1" based on "Sketch1" to another different "Sketch2"?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 11:46:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/redefine-extrude-sketch/m-p/13023313#M171817</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2024-09-16T11:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Redefine Extrude Sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/redefine-extrude-sketch/m-p/13023948#M171837</link>
      <description>&lt;P&gt;It does seem like I have seen this done before.&amp;nbsp; It should be possible because the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ExtrudeFeature_Definition" target="_blank" rel="noopener"&gt;ExtrudeFeature.Definition&lt;/A&gt;&amp;nbsp;property is Read/Write, meaning we can set a different&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-ExtrudeDefinition" target="_blank" rel="noopener"&gt;ExtrudeDefinition&lt;/A&gt;&amp;nbsp;as its value.&amp;nbsp; Possible steps might be to get a '&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ExtrudeDefinition_Copy" target="_blank" rel="noopener"&gt;Copy&lt;/A&gt;' of the existing ExtrudeDefinition to a variable, then use the definition's available 'Set' methods to change it as needed, then set that copy of the definition back as the new value of ExtrudeFeature.Definition property.&amp;nbsp; May need to do so in silent operation though, not sure.&amp;nbsp; I have not tried it recently.&amp;nbsp;&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=ExtrudeDefinition_Profile" target="_blank" rel="noopener"&gt;ExtrudeDefinition.Profile&lt;/A&gt;&amp;nbsp;property is Read/Write also, but I would only do that on the copied version of the definition, then set the definition as new definition, instead of trying to do it directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&amp;nbsp; I may have been wrong about what I remembered being possible.&amp;nbsp; I did a little local testing within a test part, and I can easily change the extents of an existing extrude feature, and can potentially change between profiles within the same sketch that the extrude feature is already pointing to, when there are multiple profiles within that same sketch.&amp;nbsp; But getting an existing extrude feature to switch to using a completely different sketch is something I have not been able to do during my initial recent testing.&amp;nbsp; I know that when using BRep references for changing extent related details, we must move end of part to before feature, then back after feature, but that should not be needed for sketch profile change, so I am not sure why it is not allowing this.&amp;nbsp; Maybe something we have to ask the folks at Autodesk about.&amp;nbsp; This has to be something that has been asked about before, because it seems very familiar.&amp;nbsp; But I lost a lot of my code snippets a while back, which contained not only code examples, but links to important/informational discussions like that.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 17:32:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/redefine-extrude-sketch/m-p/13023948#M171837</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-09-16T17:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Redefine Extrude Sketch</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/redefine-extrude-sketch/m-p/13024173#M171843</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/473476"&gt;@bradeneuropeArthur&lt;/a&gt;&amp;nbsp;,&amp;nbsp; as &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;mentioned, as far as I know we can't switch the sketch...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but we can delete and recreate the extrusion&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hope this helps,&lt;/P&gt;
&lt;P&gt;Curtis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Curtis_Waguespack_0-1726510246701.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1409827i6C45F345E58D9C56/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Curtis_Waguespack_0-1726510246701.png" alt="Curtis_Waguespack_0-1726510246701.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oPartDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oCompDef&lt;/SPAN&gt; = &lt;SPAN&gt;oPartDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSketch&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PlanarSketch&lt;/SPAN&gt;
&lt;SPAN&gt;oSketch&lt;/SPAN&gt; = &lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;Sketches&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Sketch2"&lt;/SPAN&gt;)

&lt;SPAN&gt;' Create a profile.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oProfile&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Profile&lt;/SPAN&gt;
&lt;SPAN&gt;oProfile&lt;/SPAN&gt; = &lt;SPAN&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN&gt;Profiles&lt;/SPAN&gt;.&lt;SPAN&gt;AddForSolid&lt;/SPAN&gt;

&lt;SPAN&gt;sName&lt;/SPAN&gt; = &lt;SPAN&gt;"Extrusion1"&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oExtrude&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ExtrudeFeature&lt;/SPAN&gt;
&lt;SPAN&gt;oExtrude&lt;/SPAN&gt; = &lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;Features&lt;/SPAN&gt;.&lt;SPAN&gt;ExtrudeFeatures&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;sName&lt;/SPAN&gt;)

&lt;SPAN&gt;oExtrude&lt;/SPAN&gt;.&lt;SPAN&gt;Delete&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oExtrudeDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ExtrudeDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oExtrudeDef&lt;/SPAN&gt; = &lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;Features&lt;/SPAN&gt;.&lt;SPAN&gt;ExtrudeFeatures&lt;/SPAN&gt;.&lt;SPAN&gt;CreateExtrudeDefinition&lt;/SPAN&gt;(&lt;SPAN&gt;oProfile&lt;/SPAN&gt;, &lt;SPAN&gt;kJoinOperation&lt;/SPAN&gt;)
&lt;SPAN&gt;Call&lt;/SPAN&gt; &lt;SPAN&gt;oExtrudeDef&lt;/SPAN&gt;.&lt;SPAN&gt;SetDistanceExtent&lt;/SPAN&gt;(4, &lt;SPAN&gt;kPositiveExtentDirection&lt;/SPAN&gt;)
&lt;SPAN&gt;oExtrude&lt;/SPAN&gt; = &lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;Features&lt;/SPAN&gt;.&lt;SPAN&gt;ExtrudeFeatures&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;oExtrudeDef&lt;/SPAN&gt;)

&lt;SPAN&gt;oExtrude&lt;/SPAN&gt;.&lt;SPAN&gt;Definition&lt;/SPAN&gt;.&lt;SPAN&gt;Profile&lt;/SPAN&gt; = &lt;SPAN&gt;oProfile&lt;/SPAN&gt;
&lt;SPAN&gt;oExtrude&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;sName&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 18:11:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/redefine-extrude-sketch/m-p/13024173#M171843</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2024-09-16T18:11:25Z</dc:date>
    </item>
  </channel>
</rss>

