<?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: Create MTBF MTTR using flexscript in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535571#M43488</link>
    <description>&lt;P&gt;The code to add the coupling gives me an error on the last two lines &lt;/P&gt;
&lt;P&gt;exception: FlexScript exception: Property "last" accessed on invalid node. at MODEL:/Tools/UserCommands/addBreakDowns/code&lt;/P&gt;
&lt;P&gt;exception: FlexScript exception: Property "last" accessed on invalid node. at MODEL:/Tools/UserCommands/addBreakDowns/code&lt;/P&gt;
&lt;P&gt;exception: FlexScript exception: Property "last" accessed on invalid node. at MODEL:/Tools/UserCommands/addBreakDowns/code&lt;/P&gt;
&lt;P&gt;exception: FlexScript exception: Property "name" accessed on invalid node. at MODEL:/Tools/UserCommands/addBreakDowns/code&lt;/P&gt;
&lt;P&gt;how do I resolve this? &lt;/P&gt;</description>
    <pubDate>Wed, 11 Jul 2018 18:24:43 GMT</pubDate>
    <dc:creator>mustafa_l</dc:creator>
    <dc:date>2018-07-11T18:24:43Z</dc:date>
    <item>
      <title>Create MTBF MTTR using flexscript</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535567#M43484</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.1.2 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;How do I create a MTBF object via flexscript? &lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 21:27:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535567#M43484</guid>
      <dc:creator>mustafa_l</dc:creator>
      <dc:date>2018-07-10T21:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Create MTBF MTTR using flexscript</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535568#M43485</link>
      <description>&lt;P&gt;To add a new MTBF object to the toolbox you can use this line of FlexScript&lt;/P&gt;&lt;PRE&gt;treenode table = applicationcommand("addmtbfmttr");
&lt;/PRE&gt;&lt;P&gt;If you want to configure the tool at all it gets a little more tricky. We don't currently have a nice API for configuring the MTBF, although we are hoping to add one down the road. You can still do everything through FlexScript, but nothings documented or very discoverable at the moment.&lt;/P&gt;&lt;P&gt;If you want to add new members to the tool you would use code like this:&lt;/P&gt;&lt;PRE&gt;treenode obj = model().find("Processor1");
treenode members = getvarnode(table, "members");
treenode timetables = getvarnode(obj,"timetables");

createcoupling(members, timetables);
members.last.name = obj.name;
timetables.last.name = table.name;
&lt;/PRE&gt;&lt;P&gt;If there are any other things you want to configure through code we can help you find the needed code.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 17:05:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535568#M43485</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2018-07-11T17:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create MTBF MTTR using flexscript</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535569#M43486</link>
      <description>&lt;P&gt;Thanks, &lt;/P&gt;
&lt;P&gt;A follow up question : &lt;/P&gt;
&lt;PRE&gt;treenode table = applicationcommand("addmtbfmttr");&lt;/PRE&gt;
&lt;P&gt;opens up the pop up window. How do I close it using flex script?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 17:39:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535569#M43486</guid>
      <dc:creator>mustafa_l</dc:creator>
      <dc:date>2018-07-11T17:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create MTBF MTTR using flexscript</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535570#M43487</link>
      <description>&lt;P&gt;Add a 1 as a second parameter if you don't want the properties window to open:&lt;/P&gt;&lt;PRE&gt;applicationcommand("addmtbfmttr", 1)&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jul 2018 17:43:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535570#M43487</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2018-07-11T17:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create MTBF MTTR using flexscript</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535571#M43488</link>
      <description>&lt;P&gt;The code to add the coupling gives me an error on the last two lines &lt;/P&gt;
&lt;P&gt;exception: FlexScript exception: Property "last" accessed on invalid node. at MODEL:/Tools/UserCommands/addBreakDowns/code&lt;/P&gt;
&lt;P&gt;exception: FlexScript exception: Property "last" accessed on invalid node. at MODEL:/Tools/UserCommands/addBreakDowns/code&lt;/P&gt;
&lt;P&gt;exception: FlexScript exception: Property "last" accessed on invalid node. at MODEL:/Tools/UserCommands/addBreakDowns/code&lt;/P&gt;
&lt;P&gt;exception: FlexScript exception: Property "name" accessed on invalid node. at MODEL:/Tools/UserCommands/addBreakDowns/code&lt;/P&gt;
&lt;P&gt;how do I resolve this? &lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 18:24:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535571#M43488</guid>
      <dc:creator>mustafa_l</dc:creator>
      <dc:date>2018-07-11T18:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Create MTBF MTTR using flexscript</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535572#M43489</link>
      <description>&lt;P&gt;Can you post the code you're using? And do you have an object called Processor1 in the model? That line should be changed to the object you actually want to add.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 18:26:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535572#M43489</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2018-07-11T18:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create MTBF MTTR using flexscript</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535573#M43490</link>
      <description>&lt;P&gt;Here is my code: &lt;/P&gt;
&lt;P&gt;basically, I changed a few variable names and changed the "Processor1" string that you mentioned earlier &lt;A rel="user" href="https://answers.flexsim.com/users/87/matthew.g.html" nodeid="87"&gt;@Matthew Gillespie&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;breakdown&lt;/STRONG&gt; = applicationcommand("addmtbfmttr",1);&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;treenode&lt;/STRONG&gt; &lt;STRONG&gt;mtbf&lt;/STRONG&gt; = getvarnode(&lt;STRONG&gt;breakdown&lt;/STRONG&gt;, "mtbf");&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;treenode&lt;/STRONG&gt; &lt;STRONG&gt;mttr&lt;/STRONG&gt; = getvarnode(&lt;STRONG&gt;breakdown&lt;/STRONG&gt;, "mttr");&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;treenode&lt;/STRONG&gt; &lt;STRONG&gt;firstmtbf&lt;/STRONG&gt; = getvarnode(&lt;STRONG&gt;breakdown&lt;/STRONG&gt;, "firstmtbf");&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;treenode&lt;/STRONG&gt; &lt;STRONG&gt;proc&lt;/STRONG&gt; = model().find(gettablestr(&lt;STRONG&gt;procInfoTable&lt;/STRONG&gt;,&lt;STRONG&gt;i&lt;/STRONG&gt;,&lt;STRONG&gt;col_proc_name&lt;/STRONG&gt;));&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;treenode&lt;/STRONG&gt; &lt;STRONG&gt;members&lt;/STRONG&gt; = getvarnode(&lt;STRONG&gt;breakdown&lt;/STRONG&gt;, "members");&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;treenode&lt;/STRONG&gt; &lt;STRONG&gt;timetables&lt;/STRONG&gt; = getvarnode(&lt;STRONG&gt;proc&lt;/STRONG&gt;,"timetables");&lt;/P&gt;
&lt;P&gt;createcoupling(&lt;STRONG&gt;members&lt;/STRONG&gt;, &lt;STRONG&gt;timetables&lt;/STRONG&gt;);&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;members&lt;/STRONG&gt;.last.name = &lt;STRONG&gt;proc&lt;/STRONG&gt;.name;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;timetables&lt;/STRONG&gt;.last.name = &lt;STRONG&gt;breakdown&lt;/STRONG&gt;.name;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 20:00:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535573#M43490</guid>
      <dc:creator>mustafa_l</dc:creator>
      <dc:date>2018-07-11T20:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create MTBF MTTR using flexscript</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535574#M43491</link>
      <description>&lt;P&gt;Edit: I did a bit of debugging and found that the 1 in, applicationcommand("addmtbfmttr", 1)&lt;/P&gt;
&lt;P&gt;was causing the error. (obviously withoutthe 1 the application just opensup a bunch of unwanted mttr windows. &lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 20:26:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535574#M43491</guid>
      <dc:creator>mustafa_l</dc:creator>
      <dc:date>2018-07-11T20:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create MTBF MTTR using flexscript</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535575#M43492</link>
      <description>&lt;P&gt;Huh, it no longer returns the created node if you pass in the 1. That looks like a bug. &lt;/P&gt;&lt;P&gt;Here are two workarounds:&lt;/P&gt;&lt;PRE&gt;applicationcommand("addmtbfmttr", 1);
treenode table = model().find("MTBFMTTR").last;&lt;/PRE&gt;&lt;P&gt;OR&lt;/P&gt;&lt;PRE&gt;treenode mtbfmttr = applicationcommand("addtool", "MTBFMTTR", library().find("MTBFMTTR"));&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jul 2018 20:35:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-mtbf-mttr-using-flexscript/m-p/13535575#M43492</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2018-07-11T20:35:59Z</dc:date>
    </item>
  </channel>
</rss>

