<?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: API: MultiBody parts. in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/api-multibody-parts/m-p/3841811#M142747</link>
    <description>&lt;P&gt;Sorry for bringing up such an old post. &amp;nbsp;This is exactly what I'm trying to do, but it takes such a long time. &amp;nbsp;On some of our larger parts, iterating through and setting each face on a surface body to featureRenderStyle takes hours. &amp;nbsp;Is there a faster way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Here is my current code:&lt;/P&gt;&lt;PRE&gt;foreach (SurfaceBody oSurfaceBody in oPartDef.SurfaceBodies)
{
	oSurfaceBody.SetRenderStyle(StyleSourceTypeEnum.kFeatureRenderStyle, null, true);

	foreach (Face face in oSurfaceBody.Faces)
	{
		face.SetRenderStyle(StyleSourceTypeEnum.kFeatureRenderStyle);
	}
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to make it faster or more efficient? &amp;nbsp;If Inventor were thread-safe, I'd do it in parallel. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there code similar to this that might work on a surfaceBody? ModTheMachine shows that it only selects faces that have an override.&lt;/P&gt;&lt;PRE&gt;oPartDocument.AttributeManager.FindObjects("com.autodesk.inventor.FaceAttributes", "FaceColor");&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2013 12:37:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-04-09T12:37:02Z</dc:date>
    <item>
      <title>API: MultiBody parts.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/api-multibody-parts/m-p/2752526#M142744</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I am trying to access the material and/or renderstyle for each solid in a multibody part document, but it seems like this is not supported in the API.&lt;/P&gt;&lt;P&gt;Is this correct?&lt;/P&gt;&lt;P&gt;If this is correct, why the&amp;nbsp;HasMultipleSolidBodies property? (Yes, I am probably missing something here, but... :-))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2010 20:39:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/api-multibody-parts/m-p/2752526#M142744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-08-23T20:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: API: MultiBody parts.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/api-multibody-parts/m-p/2752638#M142745</link>
      <description>&lt;P&gt;The PartComponentDefinition.SurfaceBodies returns all the solid bodies within a part. You can then call the SurfaceBody.GetRenderStyle method on each returned body to query its render style. Note that Material can only be set per document (and not per body).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this help? If not, please provide the Inventor document and sample code to reproduce the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2010 23:18:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/api-multibody-parts/m-p/2752638#M142745</guid>
      <dc:creator>sanjay.ramaswamy</dc:creator>
      <dc:date>2010-08-23T23:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: API: MultiBody parts.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/api-multibody-parts/m-p/2752816#M142746</link>
      <description>&lt;P&gt;Yes, of course! Why didn't I think of this?&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2010 06:17:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/api-multibody-parts/m-p/2752816#M142746</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-08-24T06:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: API: MultiBody parts.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/api-multibody-parts/m-p/3841811#M142747</link>
      <description>&lt;P&gt;Sorry for bringing up such an old post. &amp;nbsp;This is exactly what I'm trying to do, but it takes such a long time. &amp;nbsp;On some of our larger parts, iterating through and setting each face on a surface body to featureRenderStyle takes hours. &amp;nbsp;Is there a faster way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Here is my current code:&lt;/P&gt;&lt;PRE&gt;foreach (SurfaceBody oSurfaceBody in oPartDef.SurfaceBodies)
{
	oSurfaceBody.SetRenderStyle(StyleSourceTypeEnum.kFeatureRenderStyle, null, true);

	foreach (Face face in oSurfaceBody.Faces)
	{
		face.SetRenderStyle(StyleSourceTypeEnum.kFeatureRenderStyle);
	}
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to make it faster or more efficient? &amp;nbsp;If Inventor were thread-safe, I'd do it in parallel. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there code similar to this that might work on a surfaceBody? ModTheMachine shows that it only selects faces that have an override.&lt;/P&gt;&lt;PRE&gt;oPartDocument.AttributeManager.FindObjects("com.autodesk.inventor.FaceAttributes", "FaceColor");&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 12:37:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/api-multibody-parts/m-p/3841811#M142747</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-09T12:37:02Z</dc:date>
    </item>
  </channel>
</rss>

