<?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: Creating a sketch and Converting Parameters using iLogic in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8890151#M73973</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4253164"&gt;@Sergio.D.Suárez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But as you already comment, this (Rangebox) only works when the assembly is orientated correctly to XYZ!&lt;/P&gt;&lt;P&gt;otherwise if you like, we can share the code for the rangebox dimensions..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2019 10:15:04 GMT</pubDate>
    <dc:creator>bradeneuropeArthur</dc:creator>
    <dc:date>2019-07-04T10:15:04Z</dc:date>
    <item>
      <title>Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8888332#M73971</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble creating and converting parameters and would love some help, of course, I'm new to iLogic and I'm sure what I'd like to do is simple for most.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What we currently do:&lt;/P&gt;&lt;P&gt;I create two sketches in a finished assembly and then use those Parameters as LENGTH, WIDTH, THICK all in mm then I Create user parameters manually as ELENGTH, EWIDTH, ETHICK and use the LENGTH, WIDTH, THICK Parameters and set the units to in, Fractional, 1/16 precision.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Priority/Question 1:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I'd like to automate this with iLogic and have the rule either create the sketch and all the parameters for me including setting the "Custom Property Format"&amp;nbsp;&lt;/STRONG&gt; or skip the sketch but still grab the required dims to create the parameters needed, this would help so much to speed up the process for everyone in my dept.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"else if" Priority/Question 2:&lt;/P&gt;&lt;P&gt;If creating the sketch or grabbing the dims is to complicated I would atleast like to know how to convert the&amp;nbsp;LENGTH, WIDTH, THICK Parameters to ELENGTH, EWIDTH, ETHICK and set the&amp;nbsp;&lt;STRONG&gt;"Custom Property Formats" for both mm and inches.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;See the attached image if it helps.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank you!&amp;nbsp; Any help with this would be greatly appreciated.&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iLogic Needed to Convert mm to inches creating in a new user parameter.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/653746i6BF2041BCA5B47ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="iLogic Needed to Convert mm to inches creating in a new user parameter.PNG" alt="iLogic Needed to Convert mm to inches creating in a new user parameter.PNG" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 15:35:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8888332#M73971</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-03T15:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8890099#M73972</link>
      <description>&lt;P&gt;If you have the assembly aligned with the main planes&lt;BR /&gt;have you tried the "RangeBox" property?&lt;BR /&gt;for this property you can access two points, a maximum and a minimum, and you can set the dimensions from here, so you would not have to create a sketch and reference this to the edges of each point in the periphery of the assembly.&lt;BR /&gt;If I did not understand badly I see that you need the virtual dimensions that your assembly would occupy. regards&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 09:48:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8890099#M73972</guid>
      <dc:creator>Sergio.D.Suárez</dc:creator>
      <dc:date>2019-07-04T09:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8890151#M73973</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4253164"&gt;@Sergio.D.Suárez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But as you already comment, this (Rangebox) only works when the assembly is orientated correctly to XYZ!&lt;/P&gt;&lt;P&gt;otherwise if you like, we can share the code for the rangebox dimensions..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 10:15:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8890151#M73973</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2019-07-04T10:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8890262#M73974</link>
      <description>&lt;P&gt;@Anonymous,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hoping that below iLogic code may be helpful to converting parameters.&lt;/P&gt;
&lt;PRE&gt;Sub Main()
    Dim oDoc As PartDocument
    oDoc = ThisApplication.ActiveDocument
    
    Dim oDef As PartComponentDefinition
    oDef = oDoc.ComponentDefinition
    
    Dim oParam As UserParameter
    For Each oParam In oDef.Parameters.UserParameters
        If oParam.Name = "ELENGTH" Or oParam.Name = "EWIDTH" Or oParam.Name = "ETHICK" Then
            oParam.Units = "in"
        End If
    Next
    
    
End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 11:03:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8890262#M73974</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-07-04T11:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8895902#M73975</link>
      <description>&lt;P&gt;Thank you Sergio, I've actually never heard of that, it's a new one to me but looks promising.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have an example of what the rule would look like?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:08:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8895902#M73975</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-08T14:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8895932#M73976</link>
      <description>&lt;P&gt;I have.&lt;/P&gt;&lt;P&gt;You need it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim a As PartDocument ' or Document ' or AssemblyDocument
Set a = ThisApplication.ActiveDocument

Dim b As ComponentDefinition
Set b = a.ComponentDefinition

Dim c As Box
Set c = b.RangeBox

'Dim c1 As SurfaceBody
'Set c1 = b.SurfaceBodies.Item.Item(1)

'Dim c2 As Box
'Set c2 = c1.RangeBox

'Dim c3 As Variant
'Set c3 = c2.MaxPoint
'b.Occurrences.Item (1).RangeBox.

Dim dmax As Point
Set dmax = c.MaxPoint

Dim dmin As Point
Set dmin = c.MinPoint


MsgBox dmax.X - dmin.X &amp;amp; " " &amp;amp; dmax.Y - dmin.Y &amp;amp; " " &amp;amp; dmax.Z - dmin.Z&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:27:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8895932#M73976</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2019-07-08T14:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8895955#M73977</link>
      <description>&lt;P&gt;Braden, that would be GREAT.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most assemblies are centered on origin in the xy and the z is normally used as the ground or floor plane at least in our larger Assemblies.&amp;nbsp; So the center origin, in all of our assemblies normally isn't exactly center, a lot of times two planes are and one isn't and some co-workers assemblies or old assemblies just aren't centered at all.&lt;/P&gt;&lt;P&gt;So any rule that would work without depending the center origin would be amazing!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:28:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8895955#M73977</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-08T14:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8895995#M73978</link>
      <description>&lt;P&gt;Braden,&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anything else I need to do to make this work?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I copied/pasted, it wanted parenthesize on the msgbox, I added them and got this.&amp;nbsp; Which is great!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now how do I get that into my parameters as mm (THICK, LENGTH, WIDTH) and then create another in inches (ETHICK, ELENGTH, EWIDTH) ?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Get Dims Snippet.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/655257i397AB987DE966759/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Get Dims Snippet.PNG" alt="Get Dims Snippet.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 14:43:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8895995#M73978</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-08T14:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8896031#M73979</link>
      <description>&lt;P&gt;keep reading..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim a As PartDocument ' or Document ' or AssemblyDocument
a = ThisApplication.ActiveDocument

Dim b As ComponentDefinition
b = a.ComponentDefinition

Dim c As Box
c = b.RangeBox


Dim dmax As Point
dmax = c.MaxPoint

Dim dmin As Point
dmin = c.MinPoint


MsgBox(dmax.X - dmin.X &amp;amp; " cm " &amp;amp; dmax.Y - dmin.Y &amp;amp; " cm " &amp;amp; dmax.Z - dmin.Z &amp;amp; " cm ")
Try
	Parameter("Le") = dmax.X - dmin.X

	Catch
Dim pa1 As Inventor.Parameter
pa1 = a.ComponentDefinition.Parameters.UserParameters.AddByValue("Le", dmax.X - dmin.X, "inch")		
		End Try

Try
	Parameter("Wi") = dmax.Y - dmin.Y
	Catch
Dim pa2 As Inventor.Parameter
pa2 = a.ComponentDefinition.Parameters.UserParameters.AddByValue("Wi", dmax.Y - dmin.Y, "inch")
 		End Try
 
 Try
	 Parameter("Thi") = dmax.Z - dmin.Z
	 Catch
		 
Dim pa3 As Inventor.Parameter
pa3 = a.ComponentDefinition.Parameters.UserParameters.AddByValue("Thi",dmax.Z - dmin.Z,"inch")
		End Try
'Dim p As Inventor.Property = Nothing
'Try
'	'p = a.PropertySets.Item(4).Add(dmax.X - dmin.X, "dimX")
'	Catch 
'		'iProperties.Value("Custom", "dimX")= dmax.X - dmin.X
'		End Try

''p = a.PropertySets.Item(4).Add("100", "dimY")
'p = a.PropertySets.Item(4).Add(dmax.Z - dmin.Z,"dimY")&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jul 2019 15:06:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8896031#M73979</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2019-07-08T15:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8896051#M73980</link>
      <description>&lt;P&gt;If the assembly is parallel to the main planes, the offset does not matter with respect to the origin, the rule will give you the value you need. Please check it regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;Document&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;oCD&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBox&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Box&lt;/SPAN&gt; = &lt;SPAN&gt;oCD&lt;/SPAN&gt;.&lt;SPAN&gt;RangeBox&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oX&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;Round&lt;/SPAN&gt;(&lt;SPAN&gt;oCD&lt;/SPAN&gt;.&lt;SPAN&gt;RangeBox&lt;/SPAN&gt;.&lt;SPAN&gt;MaxPoint&lt;/SPAN&gt;.&lt;SPAN&gt;X&lt;/SPAN&gt; - &lt;SPAN&gt;oCD&lt;/SPAN&gt;.&lt;SPAN&gt;RangeBox&lt;/SPAN&gt;.&lt;SPAN&gt;MinPoint&lt;/SPAN&gt;.&lt;SPAN&gt;X&lt;/SPAN&gt;,2)*10
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oY&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;Round&lt;/SPAN&gt;(&lt;SPAN&gt;oCD&lt;/SPAN&gt;.&lt;SPAN&gt;RangeBox&lt;/SPAN&gt;.&lt;SPAN&gt;MaxPoint&lt;/SPAN&gt;.&lt;SPAN&gt;Y&lt;/SPAN&gt; - &lt;SPAN&gt;oCD&lt;/SPAN&gt;.&lt;SPAN&gt;RangeBox&lt;/SPAN&gt;.&lt;SPAN&gt;MinPoint&lt;/SPAN&gt;.&lt;SPAN&gt;Y&lt;/SPAN&gt;,2)*10
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oZ&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;Round&lt;/SPAN&gt;(&lt;SPAN&gt;oCD&lt;/SPAN&gt;.&lt;SPAN&gt;RangeBox&lt;/SPAN&gt;.&lt;SPAN&gt;MaxPoint&lt;/SPAN&gt;.&lt;SPAN&gt;Z&lt;/SPAN&gt; - &lt;SPAN&gt;oCD&lt;/SPAN&gt;.&lt;SPAN&gt;RangeBox&lt;/SPAN&gt;.&lt;SPAN&gt;MinPoint&lt;/SPAN&gt;.&lt;SPAN&gt;Z&lt;/SPAN&gt;,2)*10

&lt;SPAN&gt;oLong&lt;/SPAN&gt; = &lt;SPAN&gt;MaxOfMany&lt;/SPAN&gt;(&lt;SPAN&gt;oX&lt;/SPAN&gt;,&lt;SPAN&gt;oY&lt;/SPAN&gt;,&lt;SPAN&gt;oZ&lt;/SPAN&gt;)
&lt;SPAN&gt;oWid&lt;/SPAN&gt; = &lt;SPAN&gt;MinOfMany&lt;/SPAN&gt;(&lt;SPAN&gt;oX&lt;/SPAN&gt;, &lt;SPAN&gt;oY&lt;/SPAN&gt;, &lt;SPAN&gt;oZ&lt;/SPAN&gt;)
&lt;SPAN&gt;oHigh&lt;/SPAN&gt; = &lt;SPAN&gt;oX&lt;/SPAN&gt; + &lt;SPAN&gt;oY&lt;/SPAN&gt; + &lt;SPAN&gt;oZ&lt;/SPAN&gt; - &lt;SPAN&gt;oLong&lt;/SPAN&gt; - &lt;SPAN&gt;oWid&lt;/SPAN&gt;

&lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Length: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oLong&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;" mm"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;vbCrLf&lt;/SPAN&gt; &amp;amp; _
		&lt;SPAN&gt;"Width: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oWid&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;" mm"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;vbCrLf&lt;/SPAN&gt; &amp;amp; _
		&lt;SPAN&gt;"High: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oHigh&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;" mm"&lt;/SPAN&gt; )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 15:03:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8896051#M73980</guid>
      <dc:creator>Sergio.D.Suárez</dc:creator>
      <dc:date>2019-07-08T15:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8896361#M73981</link>
      <description>&lt;PRE&gt;&lt;SPAN&gt;Wow, they both work great!  Thank you both very much!&lt;BR /&gt;Braden that worked and added it to the parameters perfectly and I was able to copy and paste and&lt;BR /&gt;add the "LENGTH" for mm which worked as well but how do I now add the following and make it an &lt;BR /&gt;exported parameter and set the precision and everything like below?&lt;BR /&gt;&lt;BR /&gt;'Parameter.Param("ELENGTH").ExposedAsProperty = True &lt;/SPAN&gt;
&lt;SPAN&gt;'Parameter.Param("ELENGTH").CustomPropertyFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision &lt;/SPAN&gt;
&lt;SPAN&gt;'Parameter.Param("ELENGTH").CustomPropertyFormat.ShowTrailingZeros = False&lt;/SPAN&gt;
&lt;SPAN&gt;'Parameter.Param("ELENGTH").CustomPropertyFormat.ShowLeadingZeros = False &lt;/SPAN&gt;
&lt;SPAN&gt;'Parameter.Param("ELENGTH").CustomPropertyFormat.ShowUnitsString = False &lt;/SPAN&gt;
&lt;SPAN&gt;''Parameter.Param("ELENGTH").CustomPropertyFormat.Units = "in" &lt;BR /&gt;&lt;BR /&gt;and also&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;'Parameter.Param("LENGTH").ExposedAsProperty = True &lt;/SPAN&gt;
&lt;SPAN&gt;'Parameter.Param("LENGTH").CustomPropertyFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kZeroDecimalPlacePrecision &lt;/SPAN&gt;
&lt;SPAN&gt;'Parameter.Param("LENGTH").CustomPropertyFormat.ShowTrailingZeros = False&lt;/SPAN&gt;
&lt;SPAN&gt;'Parameter.Param("LENGTH").CustomPropertyFormat.ShowLeadingZeros = False &lt;/SPAN&gt;
&lt;SPAN&gt;'Parameter.Param("LENGTH").CustomPropertyFormat.ShowUnitsString = False &lt;/SPAN&gt;
&lt;SPAN&gt;'Parameter.Param("LENGTH").CustomPropertyFormat.Units = "mm" &lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jul 2019 16:52:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8896361#M73981</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-08T16:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8897045#M73982</link>
      <description>&lt;P&gt;Does anyone know how to incorporate the above into either rule?&amp;nbsp; I'm sure it's easy and I'm just to knew to this to know but it's the last piece to my puzzle and this rule will help us a ton.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for the help!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 22:20:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8897045#M73982</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-08T22:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8897484#M73983</link>
      <description>&lt;PRE&gt;Dim a As PartDocument ' or Document ' or AssemblyDocument
a = ThisApplication.ActiveDocument

Dim b As ComponentDefinition
b = a.ComponentDefinition

Dim c As Box
c = b.RangeBox


Dim dmax As Point
dmax = c.MaxPoint

Dim dmin As Point
dmin = c.MinPoint


MsgBox(dmax.X - dmin.X &amp;amp; " cm " &amp;amp; dmax.Y - dmin.Y &amp;amp; " cm " &amp;amp; dmax.Z - dmin.Z &amp;amp; " cm ")
Try
	Parameter("Length") = dmax.X - dmin.X

	Catch
Dim pa1 As Inventor.Parameter
pa1 = a.ComponentDefinition.Parameters.UserParameters.AddByValue("Length", dmax.X - dmin.X, "mm")	
pa1.ExposedAsProperty = True
pa1.CustomPropertyFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kZeroDecimalPlacePrecision
pa1.CustomPropertyFormat.ShowTrailingZeros = False
pa1.CustomPropertyFormat.ShowLeadingZeros = False
pa1.CustomPropertyFormat.ShowUnitsString = False
pa1.CustomPropertyFormat.Units = "mm"
		End Try

Try
	Parameter("Width") = dmax.Y - dmin.Y
	Catch
Dim pa2 As Inventor.Parameter
pa2 = a.ComponentDefinition.Parameters.UserParameters.AddByValue("Width", dmax.Y - dmin.Y, "mm")
pa2.ExposedAsProperty = True
pa2.CustomPropertyFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kZeroDecimalPlacePrecision
pa2.CustomPropertyFormat.ShowTrailingZeros = False
pa2.CustomPropertyFormat.ShowLeadingZeros = False
pa2.CustomPropertyFormat.ShowUnitsString = False
pa2.CustomPropertyFormat.Units = "mm"
 		End Try
 
 Try
	 Parameter("Thickness") = dmax.Z - dmin.Z
	 Catch
		 
Dim pa3 As Inventor.Parameter
pa3 = a.ComponentDefinition.Parameters.UserParameters.AddByValue("Thickness", dmax.Z - dmin.Z, "mm")
pa3.ExposedAsProperty = True
pa3.CustomPropertyFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kZeroDecimalPlacePrecision
pa3.CustomPropertyFormat.ShowTrailingZeros = False
pa3.CustomPropertyFormat.ShowLeadingZeros = False
pa3.CustomPropertyFormat.ShowUnitsString = False
pa3.CustomPropertyFormat.Units = "mm"
		End Try

Try
	Parameter("ELength") = dmax.X - dmin.X

	Catch
Dim Epa1 As Inventor.Parameter
Epa1 = a.ComponentDefinition.Parameters.UserParameters.AddByValue("ELength", dmax.X - dmin.X, "inch")	
Epa1.ExposedAsProperty = True
Epa1.CustomPropertyFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision
Epa1.CustomPropertyFormat.ShowTrailingZeros = False
Epa1.CustomPropertyFormat.ShowLeadingZeros = False
Epa1.CustomPropertyFormat.ShowUnitsString = False
Epa1.CustomPropertyFormat.Units = "inch"
		End Try

Try
	Parameter("EWidth") = dmax.Y - dmin.Y
	Catch
Dim Epa2 As Inventor.Parameter
Epa2 = a.ComponentDefinition.Parameters.UserParameters.AddByValue("EWidth", dmax.Y - dmin.Y, "inch")
Epa2.ExposedAsProperty = True
Epa2.CustomPropertyFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision
Epa2.CustomPropertyFormat.ShowTrailingZeros = False
Epa2.CustomPropertyFormat.ShowLeadingZeros = False
Epa2.CustomPropertyFormat.ShowUnitsString = False
Epa2.CustomPropertyFormat.Units = "inch"
 		End Try
 
 Try
	 Parameter("EThickness") = dmax.Z - dmin.Z
	 Catch
		 
Dim Epa3 As Inventor.Parameter
Epa3 = a.ComponentDefinition.Parameters.UserParameters.AddByValue("EThickness", dmax.Z - dmin.Z, "inch")
Epa3.ExposedAsProperty = True
Epa3.CustomPropertyFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision
Epa3.CustomPropertyFormat.ShowTrailingZeros = False
Epa3.CustomPropertyFormat.ShowLeadingZeros = False
Epa3.CustomPropertyFormat.ShowUnitsString = False
Epa3.CustomPropertyFormat.Units = "inch"
		End Try&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2019 06:31:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8897484#M73983</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2019-07-09T06:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8899065#M73984</link>
      <description>&lt;P&gt;Oh thank you so much!!!&amp;nbsp; I appreciate you taking the time to do that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works great but it only wants to add one line of ELENGTH, EWIDTH, OR ETHICK at a time and then I get (Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)).&amp;nbsp; So it runs, throws an error, when I look in parameters the first time it added Length, width, thick, and ELength.&amp;nbsp; Then when I try it again it adds EWidth and throws the error again, and then the third time ran it adds EThick and does not throw the error.&amp;nbsp; It's odd, not sure what it's missing to complete it and add them all the first time...?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ELENGTH Snippet.PNG" style="width: 963px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/655767i82880E36811BECFE/image-size/large?v=v2&amp;amp;px=999" role="button" title="ELENGTH Snippet.PNG" alt="ELENGTH Snippet.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 16:59:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8899065#M73984</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T16:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8901659#M73985</link>
      <description>&lt;P&gt;I hate to ask about this after you've already helped so much but do you get or know why that rule is doing what I mentioned above?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 16:44:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8901659#M73985</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T16:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8901704#M73986</link>
      <description>&lt;P&gt;It is in the code structure, you are attempting to use the parameter before checking to see if it exists.&amp;nbsp; Then when the error is thrown, you add the parameter.&amp;nbsp; Not the cleanest way, because error capturing actually slows down your code.&amp;nbsp; You can do a find parameter, then add if not found.&amp;nbsp; THEN move on to set the parameter value.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 16:55:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8901704#M73986</guid>
      <dc:creator>JamieVJohnson2</dc:creator>
      <dc:date>2019-07-10T16:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8902086#M73987</link>
      <description>&lt;P&gt;Thank you Jamie,&lt;/P&gt;&lt;P&gt;whats the line your thinking/referencing that I should be using to search for or Find the parameter?&amp;nbsp; Just curious...&amp;nbsp; I'm so new to this it's still too much of a guessing game for me I'm short on time at the moment, any help would be and is very much appreciated.&amp;nbsp; Thanks again!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 19:33:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8902086#M73987</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T19:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8902110#M73988</link>
      <description>&lt;P&gt;I think like this:&lt;/P&gt;&lt;PRE&gt;    Public Function FindParameter(invdoc As Inventor.Document, strParameter As String) As Parameter
        Dim cd As ComponentDefinition = Nothing
        Select Case invdoc.DocumentType
            Case Is = Inventor.DocumentTypeEnum.kAssemblyDocumentObject
                Dim docAssembly As Inventor.AssemblyDocument = invdoc
                cd = docAssembly.ComponentDefinition
            Case Is = Inventor.DocumentTypeEnum.kPartDocumentObject
                Dim docPart As Inventor.PartDocument = invdoc
                cd = docPart.ComponentDefinition
        End Select
        If cd IsNot Nothing Then
            For Each param As Parameter In cd.Parameters
                If param.Name = strParameter Then
                    Return param
                End If
            Next
        End If
        Return Nothing
    End Function&lt;/PRE&gt;&lt;P&gt;when looking for a parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 19:45:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8902110#M73988</guid>
      <dc:creator>JamieVJohnson2</dc:creator>
      <dc:date>2019-07-10T19:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a sketch and Converting Parameters using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8902312#M73989</link>
      <description>&lt;P&gt;Another way to get the bounding box limit is to use the ExtentsLength, ExtentsWidth and ExtentsHeight from the code snippets under Measure. So it would be something like this.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;LengthLimit&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Decimal&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;Measure&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;ExtentsLength&lt;/SPAN&gt; &lt;SPAN style="color: #808080;"&gt;'gets the length (x direction) of the extents of the part/assembly&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;WidthLimit&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Decimal&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;Measure&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;ExtentsWidth&lt;/SPAN&gt; &lt;SPAN style="color: #808080;"&gt;'gets the length (y direction) of the extents of the part/assembly&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;HeightLimit&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Decimal&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;Measure&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;ExtentsHeight&lt;/SPAN&gt; &lt;SPAN style="color: #808080;"&gt;'gets the length (z direction) of the extents of the part/assembly&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;Just another way. Hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DanV&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 21:10:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/creating-a-sketch-and-converting-parameters-using-ilogic/m-p/8902312#M73989</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T21:10:16Z</dc:date>
    </item>
  </channel>
</rss>

