<?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 iLogic Updating User parameters SheetMetal in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9008488#M71851</link>
    <description>&lt;P&gt;Hi everyone!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm new on this iLogic thingy, i just build things. This is a whole new world for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i'm working on a sheet metal part and this is what i want:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;Always automatically update my "user parameters" each time something change on a sheet metal part.&lt;UL&gt;&lt;LI&gt;My user parameters:&lt;UL&gt;&lt;LI&gt;Area_SM ( meaning Area of Stock Material);&lt;/LI&gt;&lt;LI&gt;Length (Length of the Flat Pattern of Stock Material);&lt;/LI&gt;&lt;LI&gt;Width (width of the Flat pattern of Stock material).&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is what it's written:&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;oDoc&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;oSMDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oSMDef&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN&gt;HasFlatPattern&lt;/SPAN&gt; = &lt;SPAN&gt;Then&lt;/SPAN&gt;
	Area_SM = extents_area = &lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;FlatExtentsArea&lt;/SPAN&gt;
	&lt;SPAN&gt;Length&lt;/SPAN&gt; = &lt;SPAN&gt;extents_length&lt;/SPAN&gt; = &lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;FlatExtentsLength&lt;/SPAN&gt;
	W&lt;SPAN&gt;idth&lt;/SPAN&gt; = &lt;SPAN&gt;extents_width&lt;/SPAN&gt; = &lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;FlatExtentsWidth&lt;/SPAN&gt;
&lt;SPAN&gt;Else&lt;BR /&gt;&lt;/SPAN&gt;        Area_SM = 0
	&lt;SPAN&gt;Length&lt;/SPAN&gt; = 0
	Width = 0

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;What i dont what:&lt;/P&gt;&lt;P&gt;- If i dont have ony Flat pattern created, then dont create a flat pattern until i do/say so;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried feature.("flatpattern") = true, FlatPattern is nothing.....etc.&lt;/P&gt;&lt;P&gt;As you can guess, i understand 000.....00 about coding. just a 30min. ago i learned what Dim was, and why it was always defined at the start, still dont know what "o(something)" stands for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to understand how this works but please dont right the anwser right way, make me understand 1st.&lt;/P&gt;&lt;P&gt;I'm still searching for tutorials and posts as examples, actually this coding was copy-paste then I modeled it into my needs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;JHG&lt;/P&gt;</description>
    <pubDate>Thu, 05 Sep 2019 16:17:38 GMT</pubDate>
    <dc:creator>cjuliao</dc:creator>
    <dc:date>2019-09-05T16:17:38Z</dc:date>
    <item>
      <title>iLogic Updating User parameters SheetMetal</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9008488#M71851</link>
      <description>&lt;P&gt;Hi everyone!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm new on this iLogic thingy, i just build things. This is a whole new world for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i'm working on a sheet metal part and this is what i want:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;Always automatically update my "user parameters" each time something change on a sheet metal part.&lt;UL&gt;&lt;LI&gt;My user parameters:&lt;UL&gt;&lt;LI&gt;Area_SM ( meaning Area of Stock Material);&lt;/LI&gt;&lt;LI&gt;Length (Length of the Flat Pattern of Stock Material);&lt;/LI&gt;&lt;LI&gt;Width (width of the Flat pattern of Stock material).&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is what it's written:&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;oDoc&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;oSMDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;oSMDef&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oSMDef&lt;/SPAN&gt;.&lt;SPAN&gt;HasFlatPattern&lt;/SPAN&gt; = &lt;SPAN&gt;Then&lt;/SPAN&gt;
	Area_SM = extents_area = &lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;FlatExtentsArea&lt;/SPAN&gt;
	&lt;SPAN&gt;Length&lt;/SPAN&gt; = &lt;SPAN&gt;extents_length&lt;/SPAN&gt; = &lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;FlatExtentsLength&lt;/SPAN&gt;
	W&lt;SPAN&gt;idth&lt;/SPAN&gt; = &lt;SPAN&gt;extents_width&lt;/SPAN&gt; = &lt;SPAN&gt;SheetMetal&lt;/SPAN&gt;.&lt;SPAN&gt;FlatExtentsWidth&lt;/SPAN&gt;
&lt;SPAN&gt;Else&lt;BR /&gt;&lt;/SPAN&gt;        Area_SM = 0
	&lt;SPAN&gt;Length&lt;/SPAN&gt; = 0
	Width = 0

&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;What i dont what:&lt;/P&gt;&lt;P&gt;- If i dont have ony Flat pattern created, then dont create a flat pattern until i do/say so;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried feature.("flatpattern") = true, FlatPattern is nothing.....etc.&lt;/P&gt;&lt;P&gt;As you can guess, i understand 000.....00 about coding. just a 30min. ago i learned what Dim was, and why it was always defined at the start, still dont know what "o(something)" stands for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to understand how this works but please dont right the anwser right way, make me understand 1st.&lt;/P&gt;&lt;P&gt;I'm still searching for tutorials and posts as examples, actually this coding was copy-paste then I modeled it into my needs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;JHG&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 16:17:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9008488#M71851</guid>
      <dc:creator>cjuliao</dc:creator>
      <dc:date>2019-09-05T16:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Updating User parameters SheetMetal</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9008869#M71852</link>
      <description>&lt;P&gt;Hi&amp;nbsp;cjuliao&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Welcome to the forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you have is very close to being correct. You just have a few syntax errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Firstly you need to add = True as shown and then you just need to remove the extra " = extents_" stuff.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's what your code should look like:&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="rrr.JPG" style="width: 566px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/674454iF4F378164A23BB24/image-size/large?v=v2&amp;amp;px=999" role="button" title="rrr.JPG" alt="rrr.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for getting a better understanding of why it didn't work, i'm not sure I can provide a detailed explanation.... other than it just has to be written in a certain syntax to compile correctly. I think with the corrected example you can learn from what you had to what it should be though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also just as a tip, you can search and ask programming questions of this type on the &lt;STRONG&gt;Inventor Customization forum&lt;/STRONG&gt; too, as that is the better forum for these types of questions.&lt;BR /&gt;&lt;A href="http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120" target="_blank"&gt;http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120&lt;/A&gt;&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>Thu, 05 Sep 2019 19:08:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9008869#M71852</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2019-09-05T19:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Updating User parameters SheetMetal</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9008968#M71853</link>
      <description>&lt;P&gt;The highlight mask marvel strikes again..&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="2019-09-05_15-59-52.jpg" style="width: 614px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/674469iC53ABF14250AAAD8/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-09-05_15-59-52.jpg" alt="2019-09-05_15-59-52.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 20:00:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9008968#M71853</guid>
      <dc:creator>Mark.Lancaster</dc:creator>
      <dc:date>2019-09-05T20:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Updating User parameters SheetMetal</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9008998#M71854</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&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="zzz.png" style="width: 214px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/674477i0340607D01F85D88/image-dimensions/214x386?v=v2" width="214" height="386" role="button" title="zzz.png" alt="zzz.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 20:15:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9008998#M71854</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2019-09-05T20:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Updating User parameters SheetMetal</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9009750#M71855</link>
      <description>&lt;P&gt;Thanks alot Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still it doesn't work.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="userParam.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/674581i3227E69532B5BD91/image-size/large?v=v2&amp;amp;px=999" role="button" title="userParam.png" alt="userParam.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Area_MP (=Area SM)&lt;/P&gt;&lt;P&gt;Comprimento (=Length)&lt;/P&gt;&lt;P&gt;Largura (=width)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Area SM it never changes when i change the sheet plate geometry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But thanks alot any ways for the forums tips. looking foward start investigating further.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards to all of you.&lt;/P&gt;&lt;P&gt;JHG&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 07:51:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9009750#M71855</guid>
      <dc:creator>cjuliao</dc:creator>
      <dc:date>2019-09-06T07:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Updating User parameters SheetMetal</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9010620#M71856</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4954570"&gt;@cjuliao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Area SM it never changes when i change the sheet plate geometry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi cjuliao&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The rule will not run unless we set a trigger to watch the parameters for changes, something like this where we watch the paramters called Leg1, Leg2 and Angle1... so that if any of these three values change then the rule runs.&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="fff.JPG" style="width: 475px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/674737iD31483C6E8984410/image-dimensions/475x471?v=v2" width="475" height="471" role="button" title="fff.JPG" alt="fff.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;oTrigger = Leg1
oTrigger = Leg2
oTrigger = Angle1

Dim oDoc As PartDocument
oDoc = ThisDoc.Document
Dim oSMDef As SheetMetalComponentDefinition
oSMDef = oDoc.ComponentDefinition
If oSMDef.HasFlatPattern = True Then
	Area_SM =  SheetMetal.FlatExtentsArea
	Length =  SheetMetal.FlatExtentsLength
	Width =  SheetMetal.FlatExtentsWidth
Else
    Area_SM = 0
	Length = 0
	Width = 0
End If&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Sep 2019 14:44:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-updating-user-parameters-sheetmetal/m-p/9010620#M71856</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2019-09-06T14:44:45Z</dc:date>
    </item>
  </channel>
</rss>

