<?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: Test an input value for number in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/test-an-input-value-for-number/m-p/6064702#M62095</link>
    <description>&lt;P&gt;Hi LonesomeJoe,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use &lt;STRONG&gt;IsNumeric&lt;/STRONG&gt; for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an iLogic example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;oInput = InputBox("Enter a number", "iLogic", "")

numericCheck = IsNumeric(oInput)

If numericCheck = True Then
MessageBox.Show("Input is numeric", "iLogic")
Else
MessageBox.Show("Input is NOT numeric.", "iLogic")
End If&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VBA example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Public Sub NumericCheck()
oInput = InputBox("Enter a number", "iLogic", "")

Dim NumericCheck As Boolean
NumericCheck = IsNumeric(oInput)

If NumericCheck = True Then
MsgBox ("Input is numeric")
Else
MsgBox ("Input is NOT numeric.")
End If

End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Mar 2016 22:45:38 GMT</pubDate>
    <dc:creator>Curtis_Waguespack</dc:creator>
    <dc:date>2016-03-01T22:45:38Z</dc:date>
    <item>
      <title>Test an input value for number</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/test-an-input-value-for-number/m-p/6064436#M62092</link>
      <description>&lt;P&gt;I have a macro which takes an input from a user form text box and stores it as a Double.&amp;nbsp; I need a way to test the input to make sure it is numerical before storing it, as it crashes the macro if the user enters a non-numerical input.&amp;nbsp; Is there a simple way to test for numerical input?&amp;nbsp; Thanx.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 20:13:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/test-an-input-value-for-number/m-p/6064436#M62092</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-01T20:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Test an input value for number</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/test-an-input-value-for-number/m-p/6064702#M62095</link>
      <description>&lt;P&gt;Hi LonesomeJoe,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use &lt;STRONG&gt;IsNumeric&lt;/STRONG&gt; for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an iLogic example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;oInput = InputBox("Enter a number", "iLogic", "")

numericCheck = IsNumeric(oInput)

If numericCheck = True Then
MessageBox.Show("Input is numeric", "iLogic")
Else
MessageBox.Show("Input is NOT numeric.", "iLogic")
End If&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VBA example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Public Sub NumericCheck()
oInput = InputBox("Enter a number", "iLogic", "")

Dim NumericCheck As Boolean
NumericCheck = IsNumeric(oInput)

If NumericCheck = True Then
MsgBox ("Input is numeric")
Else
MsgBox ("Input is NOT numeric.")
End If

End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 22:45:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/test-an-input-value-for-number/m-p/6064702#M62095</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2016-03-01T22:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Test an input value for number</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/test-an-input-value-for-number/m-p/6064707#M62096</link>
      <description>&lt;P&gt;Thanx, Curtis!&amp;nbsp; I knew there was a way to do this but I could not remember WHAT it was!&amp;nbsp; Thanx.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 22:42:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/test-an-input-value-for-number/m-p/6064707#M62096</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-01T22:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Test an input value for number</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/test-an-input-value-for-number/m-p/12118085#M155523</link>
      <description>&lt;P&gt;Is there a way to get the numeric value from the InputBox and start PartsListNumber from that or add it to the PartsListNumber? I found some code that takes all of the parts lists from a DWG and creates a new tab in Excel for each instance but I would like to have some control over the numbering of the tabs so that the tabs align with the actual location/floor level on our project. See the code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;		&lt;SPAN&gt;oInput&lt;/SPAN&gt; = &lt;SPAN&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Input the first floor level number below"&lt;/SPAN&gt;, &lt;SPAN&gt;"First Floor Level"&lt;/SPAN&gt;, &lt;SPAN&gt;""&lt;/SPAN&gt;)

		&lt;SPAN&gt;numericCheck&lt;/SPAN&gt; = &lt;SPAN&gt;IsNumeric&lt;/SPAN&gt;(&lt;SPAN&gt;oInput&lt;/SPAN&gt;)

		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;numericCheck&lt;/SPAN&gt; = &lt;SPAN&gt;True&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Input is numeric"&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;)
		&lt;SPAN&gt;Else&lt;/SPAN&gt;
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"Input is NOT numeric."&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;)
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;


        &lt;SPAN&gt;'specify the start cell&lt;/SPAN&gt;
        &lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"StartingCell"&lt;/SPAN&gt;) = &lt;SPAN&gt;"A"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;startRow&lt;/SPAN&gt;

        &lt;SPAN&gt;'specify the XLS tab name&lt;/SPAN&gt;
        &lt;SPAN&gt;'here the file name is used &lt;/SPAN&gt;
        &lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"TableName"&lt;/SPAN&gt;) = &lt;SPAN&gt;"Embeds For Level-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;PartsListNumber&lt;/SPAN&gt; &lt;SPAN&gt;'without extension&lt;/SPAN&gt;

        &lt;SPAN&gt;'choose to include the parts list title row&lt;/SPAN&gt;
        &lt;SPAN&gt;'in this example "Ye Old List of Parts" is written to the StartingCell &lt;/SPAN&gt;
        &lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"IncludeTitle"&lt;/SPAN&gt;) = &lt;SPAN&gt;False&lt;/SPAN&gt;

        &lt;SPAN&gt;'choose to autofit the column width in the xls file&lt;/SPAN&gt;
        &lt;SPAN&gt;oOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"AutoFitColumnWidth"&lt;/SPAN&gt;) = &lt;SPAN&gt;True&lt;/SPAN&gt;

        &lt;SPAN&gt;' export the Partslist to Excel with options&lt;/SPAN&gt;
        &lt;SPAN&gt;oPartslist&lt;/SPAN&gt;.&lt;SPAN&gt;Export&lt;/SPAN&gt;(&lt;SPAN&gt;fileName&lt;/SPAN&gt;, &lt;SPAN&gt;PartsListFileFormatEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kMicrosoftExcel&lt;/SPAN&gt;, &lt;SPAN&gt;oOptions&lt;/SPAN&gt;)

        &lt;SPAN&gt;PartsListNumber&lt;/SPAN&gt; = &lt;SPAN&gt;PartsListNumber&lt;/SPAN&gt; + 1&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jul 2023 18:28:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/test-an-input-value-for-number/m-p/12118085#M155523</guid>
      <dc:creator>estringer</dc:creator>
      <dc:date>2023-07-21T18:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Test an input value for number</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/test-an-input-value-for-number/m-p/12118161#M155525</link>
      <description>&lt;P&gt;Have you tried Val("StringNumericalValue"), or CDblAny("StringNumericalValue").&amp;nbsp; Both of those are in the 'System' iLogic snippets, under Strings.&amp;nbsp; But both are for returning Double (not Integer) data type from a String.&amp;nbsp; You could then attempt to convert the Double to an Integer using something like CInt() or Int(), also both in the System snippets under Math.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 18:59:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/test-an-input-value-for-number/m-p/12118161#M155525</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-07-21T18:59:52Z</dc:date>
    </item>
  </channel>
</rss>

