article

Matthew Gillespie avatar image
2 Likes"
Matthew Gillespie posted Jordan Johnson edited

FlexSim 2022 Update 2 Available

FlexSim 2022 Update 2 is now available for download.

For more in-depth discussion of the new features, check out the official software release page:

Official Software Release Page - FlexSim 2022 Update 2: AMR Modeling, AI with Bonsai, and more

You can view the Release Notes in the online user manual.

FlexSim 22.2.0 Release Notes

If you have bug reports or other feedback on the software, please email [email protected] or create a new idea in the Development space.

product announcement
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jordan Johnson avatar image Jordan Johnson ♦♦ commented ·

22.2.0 and 22.2.1 are affected by the following bug: if you attach an object to a Time Table or an MTBFMTTR, and you also use a Parameter to "Delete and Copy" that object, then the copies are attached to the Time Table or MTBFMTTR twice.

You can add the following code to your model's OnReset trigger to resolve the issue. It removes duplicate objects from Time Tables and MTBFMTTRs.

Array affectedObjects;
treenode timeTablesFolder = Model.find("Tools/TimeTables");
if (timeTablesFolder) {
    affectedObjects.append(timeTablesFolder.subnodes.toArray());
}

treenode mtbfFolder = Model.find("Tools/MTBFMTTR");
if (mtbfFolder) {
    affectedObjects.append(mtbfFolder.subnodes.toArray());
}

for (int i = 1; i <= affectedObjects.length; i++) {
    treenode obj = affectedObjects[i];
    if (!(isclasstype(obj, "TimeTable") || isclasstype(obj, "MTBFMTTR"))) {
        continue;
    }
    
    var members = getvarnode(obj, "members").subnodes;
    Map memberMap;
    Array invalidLinks;
    for (int j = 1; j <= members.length; j++) {
        treenode link = members[j];
        treenode member = link.find("+/~");
        if (!member || memberMap.find(member)) {
            invalidLinks.push(link);
        } else {
            memberMap[member] = 1;
        }
    }
    
    for (int j = 1; j <= invalidLinks.length; j++) {
        invalidLinks[j].destroy();
    }
}
0 Likes 0 ·

Article

Contributors

matthew.gillespie contributed to this article