<?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: How to access Intent Design Rule items by category via .NET API? in Inventor Engineer-To-Order (Read-Only)</title>
    <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/how-to-access-intent-design-rule-items-by-category-via-net-api/m-p/7179647#M4445</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the occurrence was created by Intent, you can inspect the attribute set "Intent" on it. The Attribute "IntentName" will contain the reference string (address of the part in Intent model tree)&lt;/P&gt;
&lt;P&gt;To get the Autotesk.Intent.Part that represents the occurrence, evaluate (in C# notation):&lt;/P&gt;
&lt;P&gt;Part p = Autodesk.Intent.IntentAPI.Instance.ActiveRoot[ refstring]&lt;/P&gt;
&lt;P&gt;Then,&amp;nbsp; p.Design will return the Design of the Part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;des.GetLocalRules() will return the collection of the Rules defined in this Design (not whole hierarchy)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For each Rule, you can determine whether if has annotation, via call to .Annotations["%%category"]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And yes, to create dynamic Rule (this is what "set rule value" is), you can use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;p.SetRuleValue( ruleName, value). Value should be the of the same datatype as defined in the Design.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[‎ hope this is in support of an existing ETO customer.&amp;nbsp;&amp;nbsp;As you should know, we are not selling ETO to new customers.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2017 17:54:45 GMT</pubDate>
    <dc:creator>AlexKorzun</dc:creator>
    <dc:date>2017-06-26T17:54:45Z</dc:date>
    <item>
      <title>How to access Intent Design Rule items by category via .NET API?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/how-to-access-intent-design-rule-items-by-category-via-net-api/m-p/7173848#M4443</link>
      <description>&lt;P&gt;Hi folks. &amp;nbsp;I have an Intent design which includes a few different types of assembly items which have a custom category name, "Component Parameters".&lt;BR /&gt;&lt;BR /&gt;I am attempting to locate these parameters from the selected assembly via .the NET API. &amp;nbsp;As best as I can tell, the underlying values are stored in Rule objects.&lt;BR /&gt;&lt;BR /&gt;Here's an example of the design code where you can see the "Component Parameters" category...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="IntentModel_Partition_ComponentParameters_IntentDesignEditor.jpg" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/370767i83B1D211E8ABB195/image-size/large?v=v2&amp;amp;px=999" role="button" title="IntentModel_Partition_ComponentParameters_IntentDesignEditor.jpg" alt="IntentModel_Partition_ComponentParameters_IntentDesignEditor.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In the Intent Model browser, selecting an assembly of that type (Partition_Assembly, in this case) and right-clicking to choose "Parameters..." displays the editable parameters...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="IntentModel_Partition_Parameters.jpg" style="width: 499px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/370768iD05B450CA7BC91EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="IntentModel_Partition_Parameters.jpg" alt="IntentModel_Partition_Parameters.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;And here you can see the "Component Parameters" category items:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="IntentModel_Partition_ComponentParameters_Dlg.jpg" style="width: 377px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/370769iAA6651A930E4639B/image-size/large?v=v2&amp;amp;px=999" role="button" title="IntentModel_Partition_ComponentParameters_Dlg.jpg" alt="IntentModel_Partition_ComponentParameters_Dlg.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;So, my questions are...&lt;BR /&gt;&lt;BR /&gt;1. How can I access this set of parameters by navigating the Active Document via the .NET API ? &amp;nbsp;(Currently, I have access to the Occurrences list of Occurrence objects at a high-level from the AssemblyComponentDefinition object).&lt;BR /&gt;&lt;BR /&gt;2. How can I locate the Category with the specific name ("Component Parameters" in this case) ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;3. Once located, is there a way to set the values, or are they limited to just being read-only from the .NET API ?&lt;BR /&gt;&lt;BR /&gt;Thank you very much for any assistance! &amp;nbsp;(in case it isn't painfully obvious, this is my first foray into Inventor and Inventor ETO so it's a bit overwhelming).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 13:58:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/how-to-access-intent-design-rule-items-by-category-via-net-api/m-p/7173848#M4443</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-23T13:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Intent Design Rule items by category via .NET API?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/how-to-access-intent-design-rule-items-by-category-via-net-api/m-p/7179647#M4445</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the occurrence was created by Intent, you can inspect the attribute set "Intent" on it. The Attribute "IntentName" will contain the reference string (address of the part in Intent model tree)&lt;/P&gt;
&lt;P&gt;To get the Autotesk.Intent.Part that represents the occurrence, evaluate (in C# notation):&lt;/P&gt;
&lt;P&gt;Part p = Autodesk.Intent.IntentAPI.Instance.ActiveRoot[ refstring]&lt;/P&gt;
&lt;P&gt;Then,&amp;nbsp; p.Design will return the Design of the Part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;des.GetLocalRules() will return the collection of the Rules defined in this Design (not whole hierarchy)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For each Rule, you can determine whether if has annotation, via call to .Annotations["%%category"]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And yes, to create dynamic Rule (this is what "set rule value" is), you can use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;p.SetRuleValue( ruleName, value). Value should be the of the same datatype as defined in the Design.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[‎ hope this is in support of an existing ETO customer.&amp;nbsp;&amp;nbsp;As you should know, we are not selling ETO to new customers.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 17:54:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/how-to-access-intent-design-rule-items-by-category-via-net-api/m-p/7179647#M4445</guid>
      <dc:creator>AlexKorzun</dc:creator>
      <dc:date>2017-06-26T17:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Intent Design Rule items by category via .NET API?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/how-to-access-intent-design-rule-items-by-category-via-net-api/m-p/7179668#M4446</link>
      <description>&lt;P&gt;Hi Alex,&lt;BR /&gt;&lt;BR /&gt;Thanks very much for your reply! &amp;nbsp;I had figured out to use&amp;nbsp;GetRuleFormula() and SetRuleValue() which has made me some good progress at the top-level of the assembly. &amp;nbsp;My big issue now is how to traverse down into child parts? &amp;nbsp;In this specific case, there is a category of rules that was created called "Project Parameters" on the root assembly. &amp;nbsp;I can get to those. &amp;nbsp;But several of the child-items have a category of rules that was created called "Component Parameters". &amp;nbsp;I need to get to those as well, but cannot figure out how to iterate through the assembly tree to find them. &amp;nbsp;Is that something simple?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 17:59:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/how-to-access-intent-design-rule-items-by-category-via-net-api/m-p/7179668#M4446</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-26T17:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Intent Design Rule items by category via .NET API?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/how-to-access-intent-design-rule-items-by-category-via-net-api/m-p/7179702#M4447</link>
      <description>&lt;P&gt;Hi Jeff,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use p.GetChildren() or p.GetAssemblyChildren() to get the collection of the child Parts.&lt;/P&gt;
&lt;P&gt;Then, for each of these parts, you can determine whether its Design is of your interest, similarly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;p.Design.IsKindOf("MyAssembly")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 18:14:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/how-to-access-intent-design-rule-items-by-category-via-net-api/m-p/7179702#M4447</guid>
      <dc:creator>AlexKorzun</dc:creator>
      <dc:date>2017-06-26T18:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Intent Design Rule items by category via .NET API?</title>
      <link>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/how-to-access-intent-design-rule-items-by-category-via-net-api/m-p/7179707#M4448</link>
      <description>&lt;P&gt;Thank you very much, Alex!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 18:14:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-engineer-to-order-read/how-to-access-intent-design-rule-items-by-category-via-net-api/m-p/7179707#M4448</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-26T18:14:13Z</dc:date>
    </item>
  </channel>
</rss>

