<?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: Triangle extrude production with inventor api c# in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/triangle-extrude-production-with-inventor-api-c/m-p/11550104#M145112</link>
    <description>Thank you Curtis. Your solution worked successfully. &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@F982DDE76110C67DBDB6AF220B48480A/emoticons/1f604.png" alt=":grinning_face_with_smiling_eyes:" title=":grinning_face_with_smiling_eyes:" /&gt;</description>
    <pubDate>Mon, 14 Nov 2022 05:05:41 GMT</pubDate>
    <dc:creator>hayattangercekler2</dc:creator>
    <dc:date>2022-11-14T05:05:41Z</dc:date>
    <item>
      <title>Triangle extrude production with inventor api c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/triangle-extrude-production-with-inventor-api-c/m-p/11546177#M145067</link>
      <description>&lt;P&gt;I want to make a triangular extrude + cut on an object with the inventor api. I use these codes for this, but "Profiles.AddForSolid();" I'm getting the "parameter incorrect" error in the function. How can I fix this error or is there a different extrude operation for the triangle?&lt;/P&gt;&lt;P&gt;error :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hayattangercekler2_0-1668175480021.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1138720i602F8C6CE63283E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hayattangercekler2_0-1668175480021.png" alt="hayattangercekler2_0-1668175480021.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;            PlanarSketch osketch = compDef.Sketches.Add(compDef.WorkPlanes[3]);

            TransientGeometry tg = _application.TransientGeometry;
            Inventor.SketchPoints points = osketch.SketchPoints;

 
            Inventor.SketchLines lines = osketch.SketchLines;


            Inventor.SketchLine line1;
            Inventor.SketchLine line2;
            Inventor.SketchLine line3;
            line1 = lines.AddByTwoPoints(tg.CreatePoint2d(0, 0), tg.CreatePoint2d(0, 40));
            line2 = lines.AddByTwoPoints(tg.CreatePoint2d(0, 40), tg.CreatePoint2d(40, 40));
            line3 = lines.AddByTwoPoints(line2.EndSketchPoint, line1.StartSketchPoint);

           

            Profile oProfile = osketch.Profiles.AddForSolid();





            ExtrudeDefinition oExtrudeDef = compDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, PartFeatureOperationEnum.kCutOperation);

            oExtrudeDef.SetDistanceExtent(4, PartFeatureExtentDirectionEnum.kSymmetricExtentDirection);

            ExtrudeFeature oExtrude = compDef.Features.ExtrudeFeatures.Add(oExtrudeDef);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 14:04:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/triangle-extrude-production-with-inventor-api-c/m-p/11546177#M145067</guid>
      <dc:creator>hayattangercekler2</dc:creator>
      <dc:date>2022-11-11T14:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Triangle extrude production with inventor api c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/triangle-extrude-production-with-inventor-api-c/m-p/11546285#M145072</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12758025"&gt;@hayattangercekler2&lt;/a&gt;.&amp;nbsp; The most common problem I see when folks are drawing geometry entirely by code, that they then intend to extrude, is 'how' the geometry is drawn.&amp;nbsp; In order for the Coincident constraints to be inferred at the end points of the profile's sections, you need to either use end points or start points of existing geometry when drawing the next connecting piece of geometry, not just matching numerical locations.&amp;nbsp; Otherwise, you would need to go back and add those coincident constraints, in order for it to be recognized as a 'closed' profile.&amp;nbsp; Your 'line3' was done correctly, but not 'line2'.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 14:54:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/triangle-extrude-production-with-inventor-api-c/m-p/11546285#M145072</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-11-11T14:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Triangle extrude production with inventor api c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/triangle-extrude-production-with-inventor-api-c/m-p/11546356#M145075</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12758025"&gt;@hayattangercekler2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not entirely sure why that was not working, but adding a line to edit the sketch and then exit the sketch before and after the AddForSolid line seems to resolve the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;{
    PartDocument oDoc = ThisDoc.Document;

    ComponentDefinition compDef;
    compDef = oDoc.ComponentDefinition;

    var _application = ThisApplication;

    PlanarSketch osketch = compDef.Sketches.Add(compDef.WorkPlanes(3));

    TransientGeometry tg = _application.TransientGeometry;
    Inventor.SketchLines lines = osketch.SketchLines;
    Inventor.SketchLine line1;
    Inventor.SketchLine line2;
    Inventor.SketchLine line3;

    line1 = lines.AddByTwoPoints(tg.CreatePoint2d(0, 0), tg.CreatePoint2d(0, 40));
    line2 = lines.AddByTwoPoints(line1.EndSketchPoint, tg.CreatePoint2d(40, 40));
    line3 = lines.AddByTwoPoints(line2.EndSketchPoint, line1.StartSketchPoint);

    osketch.Edit();
    Profile oProfile = osketch.Profiles.AddForSolid;
    osketch.ExitEdit();

    ExtrudeDefinition oExtrudeDef = compDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, PartFeatureOperationEnum.kJoinOperation);
    oExtrudeDef.SetDistanceExtent(4, PartFeatureExtentDirectionEnum.kSymmetricExtentDirection);
    ExtrudeFeature oExtrude = compDef.Features.ExtrudeFeatures.Add(oExtrudeDef);
}
&lt;/LI-CODE&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;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartDocument&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;compDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;compDef&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;_application&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&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;compDef&lt;/SPAN&gt;.&lt;SPAN&gt;Sketches&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;compDef&lt;/SPAN&gt;.&lt;SPAN&gt;WorkPlanes&lt;/SPAN&gt;(3))

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;tg&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;TransientGeometry&lt;/SPAN&gt; = &lt;SPAN&gt;_application&lt;/SPAN&gt;.&lt;SPAN&gt;TransientGeometry&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;lines&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;SketchLines&lt;/SPAN&gt; = &lt;SPAN&gt;osketch&lt;/SPAN&gt;.&lt;SPAN&gt;SketchLines&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;line1&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;SketchLine&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;line2&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;SketchLine&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;line3&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;SketchLine&lt;/SPAN&gt;

&lt;SPAN&gt;line1&lt;/SPAN&gt; = &lt;SPAN&gt;lines&lt;/SPAN&gt;.&lt;SPAN&gt;AddByTwoPoints&lt;/SPAN&gt;(&lt;SPAN&gt;tg&lt;/SPAN&gt;.&lt;SPAN&gt;CreatePoint2d&lt;/SPAN&gt;(0, 0), &lt;SPAN&gt;tg&lt;/SPAN&gt;.&lt;SPAN&gt;CreatePoint2d&lt;/SPAN&gt;(0, 40))
&lt;SPAN&gt;line2&lt;/SPAN&gt; = &lt;SPAN&gt;lines&lt;/SPAN&gt;.&lt;SPAN&gt;AddByTwoPoints&lt;/SPAN&gt;(&lt;SPAN&gt;line1&lt;/SPAN&gt;.&lt;SPAN&gt;EndSketchPoint&lt;/SPAN&gt;, &lt;SPAN&gt;tg&lt;/SPAN&gt;.&lt;SPAN&gt;CreatePoint2d&lt;/SPAN&gt;(40, 40))
&lt;SPAN&gt;line3&lt;/SPAN&gt; = &lt;SPAN&gt;lines&lt;/SPAN&gt;.&lt;SPAN&gt;AddByTwoPoints&lt;/SPAN&gt;(&lt;SPAN&gt;line2&lt;/SPAN&gt;.&lt;SPAN&gt;EndSketchPoint&lt;/SPAN&gt;, &lt;SPAN&gt;line1&lt;/SPAN&gt;.&lt;SPAN&gt;StartSketchPoint&lt;/SPAN&gt;)

&lt;SPAN&gt;osketch&lt;/SPAN&gt;.&lt;SPAN&gt;Edit&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;osketch&lt;/SPAN&gt;.&lt;SPAN&gt;Profiles&lt;/SPAN&gt;.&lt;SPAN&gt;AddForSolid&lt;/SPAN&gt;
&lt;SPAN&gt;osketch&lt;/SPAN&gt;.&lt;SPAN&gt;ExitEdit&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;compDef&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;PartFeatureOperationEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kJoinOperation&lt;/SPAN&gt;)
&lt;SPAN&gt;oExtrudeDef&lt;/SPAN&gt;.&lt;SPAN&gt;SetDistanceExtent&lt;/SPAN&gt;(4, &lt;SPAN&gt;PartFeatureExtentDirectionEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kSymmetricExtentDirection&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;compDef&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;/PRE&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;</description>
      <pubDate>Fri, 11 Nov 2022 15:21:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/triangle-extrude-production-with-inventor-api-c/m-p/11546356#M145075</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2022-11-11T15:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Triangle extrude production with inventor api c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/triangle-extrude-production-with-inventor-api-c/m-p/11546372#M145076</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12758025"&gt;@hayattangercekler2&lt;/a&gt;.&amp;nbsp; The most common problem I see when folks are drawing geometry entirely by code, that they then intend to extrude, is 'how' the geometry is drawn.&amp;nbsp; In order for the Coincident constraints to be inferred at the end points of the profile's sections, you need to either use end points or start points of existing geometry when drawing the next connecting piece of geometry, not just matching numerical locations.&amp;nbsp; Otherwise, you would need to go back and add those coincident constraints, in order for it to be recognized as a 'closed' profile.&amp;nbsp; Your 'line3' was done correctly, but not 'line2'.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12758025"&gt;@hayattangercekler2&lt;/a&gt;&amp;nbsp;... I just looked at what&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;was saying about line 2 and realized that I should mention that I changed the way that line was done as well, but I didn't see that resolve the error. Maybe it was just a bad test on my end though?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just checked again and it fails with the sketch edit lines if line 2 is done per your original example. You can test that on your end to see if the sketch edit lines are indeed needed, or if I fooled myself with those when I looked at the previously.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 15:30:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/triangle-extrude-production-with-inventor-api-c/m-p/11546372#M145076</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2022-11-11T15:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Triangle extrude production with inventor api c#</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/triangle-extrude-production-with-inventor-api-c/m-p/11550104#M145112</link>
      <description>Thank you Curtis. Your solution worked successfully. &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@F982DDE76110C67DBDB6AF220B48480A/emoticons/1f604.png" alt=":grinning_face_with_smiling_eyes:" title=":grinning_face_with_smiling_eyes:" /&gt;</description>
      <pubDate>Mon, 14 Nov 2022 05:05:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/triangle-extrude-production-with-inventor-api-c/m-p/11550104#M145112</guid>
      <dc:creator>hayattangercekler2</dc:creator>
      <dc:date>2022-11-14T05:05:41Z</dc:date>
    </item>
  </channel>
</rss>

