<?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: Stitch a composite surface via API in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/stitch-a-composite-surface-via-api/m-p/8339624#M90169</link>
    <description>&lt;P&gt;Can you attach a sample data to reproduce the problem? Don't upload confidential data.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Oct 2018 06:35:58 GMT</pubDate>
    <dc:creator>YuhanZhang</dc:creator>
    <dc:date>2018-10-17T06:35:58Z</dc:date>
    <item>
      <title>Stitch a composite surface via API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/stitch-a-composite-surface-via-api/m-p/8325485#M89914</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I load a STEP file containing a single surface, it appears in Inventor as a part with a single Work Surface coming from a "Composite Feature".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to stitch it via the API as the first step in an automation process, so I do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// Get last added document
PartDocument doc = app.Documents[1] as PartDocument;
PartComponentDefinition compDef = doc.ComponentDefinition;

// Stitch all faces in the surface
ObjectCollection args = app.TransientObjects.CreateObjectCollection();
foreach (Face face in compDef.WorkSurfaces[1].SurfaceBodies[1].Faces)
{
    args.Add(face.SurfaceBody);
}
compDef.Features.KnitFeatures.Add(args);&lt;/PRE&gt;&lt;P&gt;However, the call to&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;KnitFeatures.Add&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;just throws an exception and I don't know what's wrong. Via the UI, it's as easy as clicking on the composite surface to select the composite.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried passing the WorkSurface directly instead of all the faces, but still the&amp;nbsp;same result. Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 16:38:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/stitch-a-composite-surface-via-api/m-p/8325485#M89914</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-10T16:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Stitch a composite surface via API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/stitch-a-composite-surface-via-api/m-p/8339624#M90169</link>
      <description>&lt;P&gt;Can you attach a sample data to reproduce the problem? Don't upload confidential data.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 06:35:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/stitch-a-composite-surface-via-api/m-p/8339624#M90169</guid>
      <dc:creator>YuhanZhang</dc:creator>
      <dc:date>2018-10-17T06:35:58Z</dc:date>
    </item>
  </channel>
</rss>

