<?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: C++ vs iLogic in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-vs-ilogic/m-p/7869301#M82360</link>
    <description>&lt;P&gt;iLogic Question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would also like to set a variable to equal "--" under some conditions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course, it is currently a Number parameter and I would need a String Parameter to get it to output "--"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know in C++ there is a syntax that can temporarily change a variable to a string, how about Inventor?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the most pertinent part of the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThirdDist&lt;/SPAN&gt; &lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN&gt;1&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;inc&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; .&lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt; &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt; rounding increment ( .125, .25, .5, etc)&lt;/SPAN&gt;
&lt;SPAN&gt;X&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/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title>C++ vs iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-vs-ilogic/m-p/7868638#M82358</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I took a semester of C++ (Non-Believers) last semester in school and am currently interning for a company. I've discovered iLogic and used some very simple iLogic for rounding and computing some dimensions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering how closely C++ and iLogic compare... I notice the if... Then.. End If... tab as well as while, return, exit, etc; all terms that refresh my memory, but I would have to relearn.&amp;nbsp; I wasn't very good at C++, and am wary of throwing myself into this and not being able to figure it out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current goal would be something along the lines of..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if "A" = "Exclude";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;X = "--";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if "B" = "&lt;SPAN&gt;Exclude&lt;/SPAN&gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Y = "--";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if "C" = "&lt;SPAN&gt;Exclude&lt;/SPAN&gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Z = "--";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else Z = ThirdDistance;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;else Y = SecondDistance;&lt;/P&gt;&lt;P&gt;else X = FirstDistance;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;return 0;&lt;/P&gt;&lt;P&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A, B, C are Include/Exclude in an iAssembly.&lt;/P&gt;&lt;P&gt;X, Y, Z are Column Headings in a&amp;nbsp;&lt;/P&gt;&lt;P&gt;FirstDistance, SecondDistance, ThirdDistance are Parameter names in iAssembly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 15:08:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-vs-ilogic/m-p/7868638#M82358</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-20T15:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: C++ vs iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-vs-ilogic/m-p/7869126#M82359</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I know iLogic is more closely represent by VB or .net programming..&amp;nbsp; However I wall tag &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/105031"&gt;@Curtis_Waguespack&lt;/a&gt; for his input.&amp;nbsp; Also when it comes to Inventor iLogic or custom programming there's a separate forum for that and its located here: &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/bd-p/120&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 17:19:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-vs-ilogic/m-p/7869126#M82359</guid>
      <dc:creator>Mark.Lancaster</dc:creator>
      <dc:date>2018-03-20T17:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: C++ vs iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-vs-ilogic/m-p/7869301#M82360</link>
      <description>&lt;P&gt;iLogic Question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would also like to set a variable to equal "--" under some conditions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course, it is currently a Number parameter and I would need a String Parameter to get it to output "--"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know in C++ there is a syntax that can temporarily change a variable to a string, how about Inventor?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the most pertinent part of the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThirdDist&lt;/SPAN&gt; &lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN&gt;1&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;inc&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; .&lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt; &lt;SPAN&gt;'&lt;/SPAN&gt;&lt;SPAN&gt; rounding increment ( .125, .25, .5, etc)&lt;/SPAN&gt;
&lt;SPAN&gt;X&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Round&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Round&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;L&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;G_&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&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&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;/&lt;/SPAN&gt; &lt;SPAN&gt;inc&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;*&lt;/SPAN&gt; &lt;SPAN&gt;inc&lt;/SPAN&gt;
&lt;SPAN&gt;Else&lt;/SPAN&gt; 
&lt;SPAN&gt;X&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; "&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;
&lt;SPAN&gt;Y&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;
&lt;SPAN&gt;Z&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 18:13:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-vs-ilogic/m-p/7869301#M82360</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-20T18:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: C++ vs iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-vs-ilogic/m-p/7872623#M82361</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;As&amp;nbsp;Mark.Lancaster mentioned iLogic is a based in VB.net.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a resource link that might be helpful:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.autodesk.com/developer-network/platform-technologies/inventor/overview" target="_blank"&gt;https://www.autodesk.com/developer-network/platform-technologies/inventor/overview&lt;/A&gt;&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;&amp;nbsp;:&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;As for your question, assuming that X, Y and Z are local variable and not parameters, then you can set them to be whatever data type you want. However, using those&amp;nbsp;variables later might cause issue if you mix data types.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If "--" is just meant to be a blank value,&amp;nbsp; and you are setting a string or local variable in your code to be blank, then you might consider using ""&amp;nbsp;as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If X, Y, and X are a numeric data type such as a Double, then you might need to use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;X&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;BR /&gt;&lt;/SPAN&gt;Y = Nothing&lt;BR /&gt;Z = Nothing&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a numeric Parameter and set it to Nothing, it gets set to zero, which might or might not work for your needs. If it is a model parameter setting it to value can often cause a sketch dimension to flip and go in the opposite direction when it is set to zero and then set back to a positive number, so there are ways to deal with that, that involve creating work planes, which are projected into the sketch, and then driaving the work plane to update the&amp;nbsp;projected geometry in the sketch.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I'm sort of guessing at what you might be trying to do, so a more complete explanation of your goals with the code, and even some example files attached to a new topic on the &lt;A href="http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120" target="_blank"&gt;Inventor Customization forum &lt;/A&gt;might get you a more direct answer.&lt;BR /&gt;&lt;BR /&gt;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 17:33:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/c-vs-ilogic/m-p/7872623#M82361</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2018-03-21T17:33:45Z</dc:date>
    </item>
  </channel>
</rss>

