<?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 Applying Cost To A Material in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/applying-cost-to-a-material/m-p/10727635#M130750</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering is it possible to add a cost to a material, i know of the other solutions were you add cost to the iProperties of a part, this is not what i want. Im talking in terms of adding a cost to a finish, for example. If i want a powder coat finish, i would apply a cost to the material finish "powder coat" and then when i applied it to the product, it would give me an overall cost of using the finish "powder coat". Allowing me to know how much it would cost to use different finishes on the product.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ive been made aware that this can only really be done via Ilogic, however i lack the experience to write something this complex. Could someone point me inn the right direction? I know i will have to first find the mass and then appearance or the part, from there use the cost of the finish and multiple by the overall mass?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-forum/applying-cost-to-a-material/m-p/10727551/highlight/false#M845363" target="_blank" rel="noopener"&gt;Re: Applying Cost To A Material - Autodesk Community - Inventor&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 01 Nov 2021 11:43:06 GMT</pubDate>
    <dc:creator>adam.mangan</dc:creator>
    <dc:date>2021-11-01T11:43:06Z</dc:date>
    <item>
      <title>Applying Cost To A Material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/applying-cost-to-a-material/m-p/10727635#M130750</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering is it possible to add a cost to a material, i know of the other solutions were you add cost to the iProperties of a part, this is not what i want. Im talking in terms of adding a cost to a finish, for example. If i want a powder coat finish, i would apply a cost to the material finish "powder coat" and then when i applied it to the product, it would give me an overall cost of using the finish "powder coat". Allowing me to know how much it would cost to use different finishes on the product.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ive been made aware that this can only really be done via Ilogic, however i lack the experience to write something this complex. Could someone point me inn the right direction? I know i will have to first find the mass and then appearance or the part, from there use the cost of the finish and multiple by the overall mass?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-forum/applying-cost-to-a-material/m-p/10727551/highlight/false#M845363" target="_blank" rel="noopener"&gt;Re: Applying Cost To A Material - Autodesk Community - Inventor&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 01 Nov 2021 11:43:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/applying-cost-to-a-material/m-p/10727635#M130750</guid>
      <dc:creator>adam.mangan</dc:creator>
      <dc:date>2021-11-01T11:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Applying Cost To A Material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/applying-cost-to-a-material/m-p/10728637#M130770</link>
      <description>&lt;P&gt;I don't know a way to add cost to a material. Instead, you can save the data in an iLogic rule (or a separate file but that is not in this example). just add the material and cost to the top of the rule.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ce5c95;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Class&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;ThisRule&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Main&lt;/SPAN&gt;()
        &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;costs&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Dictionary&lt;/SPAN&gt;(&lt;SPAN style="color: #ce5c95;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;materialCost&lt;/SPAN&gt;)
        &lt;SPAN style="color: #b2b2b5;"&gt;' Add material and csot here.&lt;/SPAN&gt;
        &lt;SPAN style="color: #b2b2b5;"&gt;' costs.Add("[Material name]", New materialCost([Material cost (../Kg)], [Surface treatment cost (../Cm^2)]))&lt;/SPAN&gt;
        &lt;SPAN style="color: #db9652;"&gt;costs&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Generic"&lt;/SPAN&gt;, &lt;SPAN style="color: #ce5c95;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;materialCost&lt;/SPAN&gt;(10, 30))
        &lt;SPAN style="color: #db9652;"&gt;costs&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Brass, Soft Yellow"&lt;/SPAN&gt;, &lt;SPAN style="color: #ce5c95;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;materialCost&lt;/SPAN&gt;(20, 0))

        &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Document&lt;/SPAN&gt;
        &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;materialName&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ActiveMaterial&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;DisplayName&lt;/SPAN&gt;

        &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt; (&lt;SPAN style="color: #db9652;"&gt;costs&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ContainsKey&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;materialName&lt;/SPAN&gt;)) &lt;SPAN style="color: #ce5c95;"&gt;Then&lt;/SPAN&gt;
            &lt;SPAN style="color: #b2b2b5;"&gt;' mass is in Kg&lt;/SPAN&gt;
            &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;mass&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;MassProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Mass&lt;/SPAN&gt;
            &lt;SPAN style="color: #b2b2b5;"&gt;' area is in Cm^2&lt;/SPAN&gt;
            &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;area&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;MassProperties&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Area&lt;/SPAN&gt;

            &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;cost&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;materialCost&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;costs&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Item&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;materialName&lt;/SPAN&gt;)
            &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;materialCost&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;mass&lt;/SPAN&gt; * &lt;SPAN style="color: #db9652;"&gt;cost&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Material&lt;/SPAN&gt;
            &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;surfaceTreatmentCost&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;area&lt;/SPAN&gt; * &lt;SPAN style="color: #db9652;"&gt;cost&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;SurfaceTreatment&lt;/SPAN&gt;
            &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;totalCost&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;materialCost&lt;/SPAN&gt; + &lt;SPAN style="color: #db9652;"&gt;surfaceTreatmentCost&lt;/SPAN&gt;
            &lt;SPAN style="color: #ce5c95;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;txt&lt;/SPAN&gt; = &lt;SPAN style="color: #35b173;"&gt;"Material: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;materialCost&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Environment&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;NewLine&lt;/SPAN&gt;
            &lt;SPAN style="color: #db9652;"&gt;txt&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;txt&lt;/SPAN&gt; + &lt;SPAN style="color: #35b173;"&gt;"Surface treatment: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;surfaceTreatmentCost&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;System&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Environment&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;NewLine&lt;/SPAN&gt;
            &lt;SPAN style="color: #db9652;"&gt;txt&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;txt&lt;/SPAN&gt; + &lt;SPAN style="color: #35b173;"&gt;"Total: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;totalCost&lt;/SPAN&gt;
            &lt;SPAN style="color: #db9652;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;txt&lt;/SPAN&gt;)
        &lt;SPAN style="color: #ce5c95;"&gt;Else&lt;/SPAN&gt;
            &lt;SPAN style="color: #db9652;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #35b173;"&gt;"Unable to calculate cost for material: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #db9652;"&gt;materialName&lt;/SPAN&gt;)
        &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;If&lt;/SPAN&gt;

    &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Class&lt;/SPAN&gt;

&lt;SPAN style="color: #ce5c95;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Class&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;materialCost&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;New&lt;/SPAN&gt;(&lt;SPAN style="color: #db9652;"&gt;material&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt;, &lt;SPAN style="color: #db9652;"&gt;surfaceTreatment&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt;)
        &lt;SPAN style="color: #ce5c95;"&gt;Me&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;Material&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;material&lt;/SPAN&gt;
        &lt;SPAN style="color: #ce5c95;"&gt;Me&lt;/SPAN&gt;.&lt;SPAN style="color: #db9652;"&gt;SurfaceTreatment&lt;/SPAN&gt; = &lt;SPAN style="color: #db9652;"&gt;surfaceTreatment&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Sub&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Property&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;Material&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt;
    &lt;SPAN style="color: #ce5c95;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Property&lt;/SPAN&gt; &lt;SPAN style="color: #db9652;"&gt;SurfaceTreatment&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Double&lt;/SPAN&gt;
&lt;SPAN style="color: #ce5c95;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ce5c95;"&gt;Class&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 19:50:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/applying-cost-to-a-material/m-p/10728637#M130770</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2021-11-01T19:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Applying Cost To A Material</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/applying-cost-to-a-material/m-p/11940346#M152180</link>
      <description>&lt;P&gt;能將值對應到iproperty中嗎&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-inline" image-alt="sun069099_0-1683171589262.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1210234i977A1C5553CCC613/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sun069099_0-1683171589262.png" alt="sun069099_0-1683171589262.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 03:40:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/applying-cost-to-a-material/m-p/11940346#M152180</guid>
      <dc:creator>sun069099</dc:creator>
      <dc:date>2023-05-04T03:40:02Z</dc:date>
    </item>
  </channel>
</rss>

