<?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: Ilogic Parameter Passing in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8650947#M78022</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1251402"&gt;@philip1009&lt;/a&gt;&amp;nbsp;Have you tried to replicate the error, and if so were you able to do so?&lt;/P&gt;</description>
    <pubDate>Mon, 11 Mar 2019 19:57:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-03-11T19:57:31Z</dc:date>
    <item>
      <title>Ilogic Parameter Passing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8649545#M78016</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to get a code that will allow the user to pass through variables from an assembly into all the referenced parts. I seem to have this mostly working but i'm running into a weird error that i can't figure out what the cause would be.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A little information on the code itself, the code first loops through all parameters in the assembly finding unique names, i.e. not d#, then using whether the parameter is key to decide if it should be passed or not. code includes methods to add or remove variables. the code then loops through all referenced documents, make a few checks, such as is modifiable or has a skip requirement. I then loop through all parameters in the referenced document and change its value if it is the correct name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code runs perfectly when i first open a document, but as soon as i hit save i start getting errors. i know for a fact that the error is occurring when doing the following,&amp;nbsp;&lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Parameters&lt;/SPAN&gt;.&lt;SPAN&gt;Count. I have attached the code if you would like to take a look.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm mostly wondering is there a better way to get the number of parameters or a better way to loop through them. i know i could just use Parameter(oDoc, "Variable Name") = vVal, and either contain this in a try catch block or turn errors to quiet, but i would like to know if there is an error passing a variable so that i can inform the user, so i at least&amp;nbsp;need to differentiate parameter doesn't exist, from other errors, as i know there will be a lot of doesn't exist errors.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Logan&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 11:55:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8649545#M78016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-11T11:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic Parameter Passing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8649606#M78017</link>
      <description>&lt;P&gt;What does the error window tell you when it fails to save, is it just saving that makes the issue, or is it changing or possibly adding the parameter?&amp;nbsp; Under the Parameters property are properties for ModelParameters, ReferenceParameters, and UserParameters that then allow methods to add a Parameter and counting.&amp;nbsp; I'm guessing you only need to go under UserParameters since that's the recommended place to put your important parameters.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 12:23:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8649606#M78017</guid>
      <dc:creator>philip1009</dc:creator>
      <dc:date>2019-03-11T12:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic Parameter Passing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8649650#M78018</link>
      <description>&lt;P&gt;There is no error in saving, the error is in running the code. I want to be able to pass model, reference, and user parameters. I don't have a problem in the assembly, its in the counting of parameters in the sub assemblies. the code is meant to be manually ran when the user want to pass variables. right now the error causing line is contained in a try catch block. but i believe when its not it will throw a member not found error.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 12:39:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8649650#M78018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-11T12:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic Parameter Passing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8650086#M78019</link>
      <description>&lt;P&gt;I just tried running the rule where i'd try counting just the user parameters, reference parameters, and model parameters individually or just 1 set and i got a similar result.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just to clarify the problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First Open -&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Code Works&lt;/P&gt;
&lt;P&gt;Make Model Changes -&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Code Works&lt;/P&gt;
&lt;P&gt;Save Assembly -&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Code Works&lt;/P&gt;
&lt;P&gt;Trigger Save on Dependent Part - Errors start&lt;/P&gt;
&lt;P&gt;Close/Open Assembly -&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Code Works&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The part that i'm having the most part diagnosing is that the code works perfectly until you go to save and save the dependant part that you just changed through the code. it will then sometimes throw an error, sometimes it will take 2/3 saves before it throws the error. i have not had the code error before saving a dependent, at least not for the same reason. The fact that closing and opening the assembly allows it to work again is what i'm having trouble understanding, if it just had an error all the time it would make more sense to me.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 15:11:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8650086#M78019</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-11T15:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic Parameter Passing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8650777#M78020</link>
      <description>&lt;P&gt;Before causing the save trigger, go through a test document to see if the parameters pass through the way you want them to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing I can think of to make looping through the parameters easier is to loop each parameter in the collection:&lt;/P&gt;
&lt;P&gt;"For Each oUserParam In ThisDoc.Document.ComponentDefinition.Parameters.UserParameters"&lt;/P&gt;
&lt;P&gt;That way you don't have to waste a line of code to get each parameter through its index number.&amp;nbsp; I also definitely recommend that any and all important parameters be put in User Parameters, this will also save the time of checking against all d## parameters and only having to check if it's keyed or not.&amp;nbsp; Checking and editing Modeling Parameters can have issues, and Reference Parameters can't be edited in the table.&amp;nbsp; Therefore only checking and passing User Parameters can eliminate a lot of error possibilities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for the random errors on save, I'm not sure about the cause yet, if it was caused by the code, then it would happen every time.&amp;nbsp; I'll keep looking through the code to see if there's other possibilities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the error only happening on Sheet Metal Parts or other specialty parts like those made in the Cable &amp;amp; Harness or Tube &amp;amp; Pipe environments?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 18:44:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8650777#M78020</guid>
      <dc:creator>philip1009</dc:creator>
      <dc:date>2019-03-11T18:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic Parameter Passing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8650925#M78021</link>
      <description>&lt;P&gt;Thanks Philip for taking the time to look. I understand where your coming from with regards to the user parameters, and maybe i'll consider making the change, and also check with coworkers on this practice. personally i prefer to be able to change the variable from inside the sketches/features directly, which means i like working with the model parameters. this code is also not meant to be ran constantly, so a little extra time isn't a deal breaker in my opinion, but again i'll check with coworkers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the problem specifically i'm seeing in the code was on line 152 of what i posted. I tried to run the code in the past using for each oparam in oDoc.&lt;SPAN&gt;ComponentDefinition.Parameters, but i believe this was generating a similar error, its harder to confirm, due to containing the entire loop in a try/catch, but i know it gave a similar response of working when first open and then not working after a save. and it would also mean i can't check if a specific variable had a failure in a part. the current method lets me check if a part is failing as well as checking if a parameter is failing, but of course if i figure out how to not have a part failure, i can go back to that method.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;i only run the code in assemblies, but the problem line doesn't seem to be to a specific type of part, it pulls out library and standard content center parts as those are not modifiable to begin with, but it looks like the problem will be sheet metal, regular, custom content center, derived, the only two things i don't see errors on are imported parts, and bases components that aren't in the assembly, but a part is derived from.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 19:46:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8650925#M78021</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-11T19:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic Parameter Passing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8650947#M78022</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1251402"&gt;@philip1009&lt;/a&gt;&amp;nbsp;Have you tried to replicate the error, and if so were you able to do so?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 19:57:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8650947#M78022</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-11T19:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic Parameter Passing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8651633#M78023</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After reading discussion in&amp;nbsp;this post, I feel that a sample assembly file with related document would be helpful to reproduce the error.&amp;nbsp;Is it possible to provide files?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please make sure that files are non confidential.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 05:33:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8651633#M78023</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-03-12T05:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic Parameter Passing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8652376#M78024</link>
      <description>&lt;P&gt;I've tried replicating and can't get any errors so far.&amp;nbsp; I don't think it's something inherent in the code causing errors, otherwise it would happen more consistently, I think there's something specific to a part or assembly file that I haven't thought of yet.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 12:30:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8652376#M78024</guid>
      <dc:creator>philip1009</dc:creator>
      <dc:date>2019-03-12T12:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic Parameter Passing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8652541#M78025</link>
      <description>&lt;P&gt;So i went to do a pack and go of the assembly i'm working on to upload to show you what was wrong, but i came across something interesting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in the past to try and figure out what was wrong, i've done the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Run it on different assemblies on my computer&lt;/LI&gt;
&lt;LI&gt;had a coworker run it in one of the assemblies they were working on&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;After making the Pack and Go i opened it to make sure there was no problem with the files, and tried to run the code, could get the error to trigger. So i had a coworker download original files from vault, but couldn't get the error. i moved the files on my computer and got from vault, no error, and now it's not throwing the error every time after save, even on older assemblies that it was doing it on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can upload the pack and go if you would like to look at, but from what i can tell, you may not be able replicate the error.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next time i get the error, i'll remove the try block and get a screenshot of the error itself, but i believe it is a late get statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 13:23:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-passing/m-p/8652541#M78025</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-12T13:23:41Z</dc:date>
    </item>
  </channel>
</rss>

