<?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: Loop value on iproperties in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9253548#M104604</link>
    <description>&lt;P&gt;Hi, thanks for help me, this didn't work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erro.jpg" style="width: 528px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/717378i38C4A809A05CF64B/image-size/large?v=v2&amp;amp;px=999" role="button" title="erro.jpg" alt="erro.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=/&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2020 23:34:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-01-15T23:34:04Z</dc:date>
    <item>
      <title>Loop value on iproperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9248332#M104502</link>
      <description>&lt;P&gt;Hi, it's possible to get the loop's value on custom iproperties like the image below?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="loop.jpg" style="width: 447px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/716429iA02ABC0A4AE7A4EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="loop.jpg" alt="loop.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 23:54:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9248332#M104502</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-13T23:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Loop value on iproperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9249207#M104520</link>
      <description>&lt;P&gt;There are multiple ways to get that information into the Custom iProperties.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You could manually enter it within that Custom tab of the iProperties&lt;/LI&gt;&lt;LI&gt;If the value you want is already a Parameter in your Fx Parameters dialog box, then within the Parameters dialog box, you could click on the Export Parameter checkbox in its row.&amp;nbsp; This automatically copies it to the Custom iProperties.&lt;/LI&gt;&lt;LI&gt;You could use an iLogic rule to transfer that data to the Custom iProperties&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Can you please be more informational as to what you need?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 11:39:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9249207#M104520</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-01-14T11:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Loop value on iproperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9249391#M104523</link>
      <description>I would like to use a ilogic rule to get it automatically on custom iproperties</description>
      <pubDate>Tue, 14 Jan 2020 13:09:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9249391#M104523</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-14T13:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Loop value on iproperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9249465#M104526</link>
      <description>&lt;P&gt;Would this work for you then?&lt;/P&gt;&lt;PRE&gt;Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCustPropSet As PropertySet = oDoc.PropertySets.Item("Inventor User Defined Properties")
Dim oFace As Face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select a Part Face.")
Dim oMeasure As MeasureTools
Dim oTLL As Double = oMeasure.GetLoopLength(oFace.Edges)  'oTLL is short for Total Loop Length
Dim oTLL_Prop As [Property] = oCustPropSet.Add(oTLL,"Total Loop Length")&lt;/PRE&gt;&lt;P&gt;If this solves your problem, please "Accept As Solution".&lt;/P&gt;&lt;P&gt;Or if it helps you along the way to achieving your goal, please click "Like".&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 13:42:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9249465#M104526</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-01-14T13:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Loop value on iproperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9252439#M104580</link>
      <description>&lt;P&gt;I'm having the same problem and can't solve it.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 15:07:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9252439#M104580</guid>
      <dc:creator>cassiano.godoy</dc:creator>
      <dc:date>2020-01-15T15:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Loop value on iproperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9252544#M104584</link>
      <description>&lt;P&gt;Perhaps if I added a MessageBox question, and a check for that iProperty at the end like this.&lt;/P&gt;&lt;PRE&gt;Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCustPropSet As PropertySet = oDoc.PropertySets.Item("Inventor User Defined Properties")
Dim oFace As Face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select a Part Face.")
Dim oMeasure As MeasureTools
Dim oTLL As Double = oMeasure.GetLoopLength(oFace.Edges)  'oTLL is short for Total Loop Length
oAnswer = MessageBox.Show("Total Loop Length = " &amp;amp; oTLL &amp;amp; vbNewLine &amp;amp; 
"Do you want To write this value To iProperties ? ", " TOTAL Loop LENGTH ", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
If oAnswer = vbNo Then
	Return
ElseIf oAnswer = vbYes Then
	'The following checks to see if that iProperty already exists.
	'In case you have already ran this rule before on the same document.
	Dim oExists As Boolean = False
	For Each oProp As [Property] In oCustPropSet
		If oProp.Name = "Total Loop Length" Then
			oExists = True
		End If
	Next
	If oExists = False Then
		oCustPropSet.Add(oTLL, "Total Loop Length")
	ElseIf oExists = True Then
		oCustPropSet.Item("Total Loop Length").Value = oTLL
	End If
End If&lt;/PRE&gt;&lt;P&gt;Does this work for you?&lt;/P&gt;&lt;P&gt;If this solves your problem, please click 'Accept As Solution'.&lt;/P&gt;&lt;P&gt;Or if this helps you along the way to reaching your goal, please click the 'Like' button. &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 15:41:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9252544#M104584</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-01-15T15:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Loop value on iproperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9253548#M104604</link>
      <description>&lt;P&gt;Hi, thanks for help me, this didn't work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erro.jpg" style="width: 528px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/717378i38C4A809A05CF64B/image-size/large?v=v2&amp;amp;px=999" role="button" title="erro.jpg" alt="erro.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=/&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 23:34:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9253548#M104604</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-15T23:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Loop value on iproperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9254631#M104624</link>
      <description>&lt;P&gt;Sorry about that.&amp;nbsp; My mistake.&amp;nbsp; I didn't properly define the MeasureTools.&amp;nbsp; I left out the "= ThisApplication.MeasureTools" at the end of that line. I didn't take the time to test the code before posting it last time.&lt;/P&gt;&lt;P&gt;Here's the working version.&lt;/P&gt;&lt;PRE&gt;Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCustPropSet As PropertySet = oDoc.PropertySets.Item("Inventor User Defined Properties")
Dim oFace As Face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select a Part Face.")
Dim oMeasure As MeasureTools = ThisApplication.MeasureTools
Dim oTLL As Double
oTLL = oMeasure.GetLoopLength(oFace.EdgeLoops.Item(1))  'oTLL is short for Total Loop Length
oAnswer = MessageBox.Show("Total Loop Length = " &amp;amp; oTLL &amp;amp; vbNewLine &amp;amp; 
"Do you want To write this value To iProperties ? ", " TOTAL LOOP LENGTH ", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
If oAnswer = vbNo Then
	Return
ElseIf oAnswer = vbYes Then
	'The following checks to see if that iProperty already exists.
	'In case you have already ran this rule before on the same document.
	Dim oExists As Boolean = False
	For Each oProp As [Property] In oCustPropSet
		If oProp.Name = "Total Loop Length" Then
			oExists = True
		End If
	Next
	If oExists = False Then
		oCustPropSet.Add(oTLL, "Total Loop Length")
	ElseIf oExists = True Then
		oCustPropSet.Item("Total Loop Length").Value = oTLL
	End If
End If&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Jan 2020 12:46:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9254631#M104624</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-01-16T12:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Loop value on iproperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9916819#M118806</link>
      <description>&lt;P&gt;Sorry, I didn't work, when the value appears on the custom iproperties the value was wrong.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2020 00:50:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9916819#M118806</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-05T00:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Loop value on iproperties</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9917838#M118813</link>
      <description>&lt;P&gt;You may need to convert the value to your local document units.&amp;nbsp; By default, any Double type values that are returned from iLogic's built-in measurement functions, are always given in the "Database Units" for that type of measurement. The "Database Units" used for Length measurements is always Centimeters, instead of the units specified within the Document Settings.&amp;nbsp; That's just how iLogic is set up, and that can't be changed.&amp;nbsp; However, you can convert the returned values by which ever means you prefer.&amp;nbsp; You can simply include some extra math in your code to compensate for the unit differences, or you can use Inventor's built-in unit converter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an updated version of that code, in which I am converting the units to Inches, instead of leaving them in default Centimeters.&amp;nbsp; I've also included the Perimeter measurement, to show the difference (when applicable).&lt;/P&gt;&lt;LI-CODE lang="general"&gt;If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then
	MsgBox("A Part Document must be active for this rule to work. Exiting.", vbOKOnly + vbCritical, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCustPropSet As PropertySet = oPDoc.PropertySets.Item("Inventor User Defined Properties")
Dim oFace As Face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select a Part Face.")
Dim oMeasure As MeasureTools = ThisApplication.MeasureTools
Dim oPerimeter, oOther, oTLL As Double

For Each oEL As EdgeLoop In oFace.EdgeLoops
	If oEL.IsOuterEdgeLoop Then
		'&amp;lt;&amp;lt;&amp;lt; This doesn't accound for interior holes or cutouts &amp;gt;&amp;gt;&amp;gt; 
		oPerimeter = oMeasure.GetLoopLength(oEL)
	Else
		oOther = oOther + oMeasure.GetLoopLength(oEL)
	End If
Next
oTLL = (oPerimeter + oOther)

'Convert the Database Units (Centimeters) to Inches
'oPerimeter = (oPerimeter / 2.54)
'oOther = (oOther / 2.54)
'or
oPerimeter = ThisApplication.UnitsOfMeasure.ConvertUnits(oPerimeter, UnitsTypeEnum.kDatabaseLengthUnits, UnitsTypeEnum.kInchLengthUnits)
oOther = ThisApplication.UnitsOfMeasure.ConvertUnits(oOther, UnitsTypeEnum.kDatabaseLengthUnits, UnitsTypeEnum.kInchLengthUnits)

'the measured units have already been converted now, so the math with be in Inches
oTLL = (oPerimeter + oOther)

oAns = MsgBox("Perimiter = " &amp;amp; oPerimeter &amp;amp; vbCrLf &amp;amp; _
"Other Interior Loop Lengths = " &amp;amp; oOther &amp;amp; vbCrLf &amp;amp; _
"Total Loop Length = " &amp;amp; oTLL &amp;amp; vbCrLf &amp;amp; _
"Do you want to write the Total Loop Length value to iProperties? ", vbYesNo + vbQuestion + vbDefaultButton2, " TOTAL LOOP LENGTH ")
If oAns = vbNo Then
	Exit Sub
ElseIf oAns = vbYes Then
	'checking if that iProperty already exists or if it needs to be created
	Dim oExists As Boolean 'False by default
	For Each oProp As Inventor.Property In oCustPropSet
		If oProp.Name = "Total Loop Length" Then
			oProp.Value = oTLL
			oExists = True
		End If
	Next
	If oExists = False Then
		oCustPropSet.Add(oTLL, "Total Loop Length")
	End If
End If&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;If you have time, please... Vote For &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B166FEBB95D67CFA84899D32D8E17FC1/emoticons/1f4a1.png" alt=":light_bulb:" title=":light_bulb:" /&gt;&lt;/SPAN&gt;&lt;/A&gt;and Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/" target="_blank"&gt;Inventor 2021 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2020 17:25:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-value-on-iproperties/m-p/9917838#M118813</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-12-05T17:25:02Z</dc:date>
    </item>
  </channel>
</rss>

