Metamation Developer Notes

  • Developer Notes
  • Resource Map
  • Tools
    • Code Formatting
    • Configuring Git
    • Assignments
    • Testing with Windows Sandbox
    • Single Binary Applications
    • Self-Updating Applications
  • Flux Workflow
    • Flux Workflow
    • Flux Development Style Guide
    • Release notes for Flux
    • SonarCloud analysis for Flux
    • Build a Flux SDK Program
    • Shipping Flux
    • Flux.Test
      • BasicBendAuto Test
      • LaserAuto.cs Detailed Documentation
      • Laserexample:Test1
  • Technical Notes
    • File formats
      • .FX File Format
      • Au(Gold) streams
      • .GEO File Format
      • .LST File Format
      • .LST file - technology
      • .BNC File Format
      • .WAD Files: Flux Resource Packages
      • .Curl Files: ASCII config information
    • Folders App
      • Data\Bendtools
      • Data\Machines
    • FluxCode
      • Welcome & Repo Map
      • Architecture & System Context
      • Subsystem *Bend* (Press Brake)
      • Subsystem *BCell* (Bend Cell Automation)
      • API Maps
      • Data Model Catalog
      • Design Patterns -- A Reader's Guide
      • Tests and Golden Paths
      • Guided Code Tours
      • CAM Glossary with Code Mapping
      • Assignments
      • Flux Onboarding Handbook
    • Data flow
      • Part
        • Part.Dwg
        • Part.Load
        • Part.Load to Part.Dwg
      • BendTech.cs
      • Bend Technology
      • Laser Cutting Technology
    • LTS (Long term support mechanism)
    • Machine ID Scheme
  • FluxTester
    • Commands and Scripts
    • Command Cookbook
    • Script Commands
    • BendTooling.cs Test Inventory
    • LaserTooling.cs Test Steps
    • Fluxtester Recipe Book
    • Nesting.cs Overview
    • Nesting.cs Recipe Book
    • Job.cs Overview
    • Job.cs Recipe Book
  • Software license
  • 3d party software
    • Python
  • Documentation
    • Bento documentation
      • Structure of a Bento page
      • Attributes
    • Software
      • Software Requirement
      • Installation
      • Git workflow for documentation contributors
    • Quick start guide
    • Workflow
      • Roles and responsibilities
      • Analyze
      • Edit
      • Proofread
      • Pre-Publish
      • Publish
      • Release cycle
      • Information required for Documentation Team
      • Checklist for Documenters
    • Styleguide
    • Flavoring
    • Translation
      • Ordering translation for a new document
    • Citations
    • Annotation
FluxTester
/
Script Commands

Script Commands

The test suite also uses many single-string script calls (RunScript("…​") and RunScriptWithOutput("…​")). These commands mostly fall into a few common groups.

Selection Commands

Most frequent group. Used to open globs and target objects for UI edits.

RunScript("Flux.Hub.SetSelection(Flux.PartEditor.Current.Part.BendTech.Ops[0], Flux.EModifiers.None);");
RunScript("Flux.Hub.SetSelection(Flux.PartEditor.Current.Part.BendTech.Ops[0].Setup.Mounts.First(a=>a.IsUpper), Flux.EModifiers.None);");
RunScript("Flux.Hub.SetSelection(Flux.PartEditor.Current.Part.BendTech.Cell.GripperBC, Flux.EModifiers.None);");
RunScript("Flux.BHub.SetSelection(Flux.PartEditor.Current.Part.Dwg.Entities[0], Flux.EModifiers.None);");

Machine/Tool Cache Reset Commands

Used after config/inventory changes to avoid stale state.

RunScript("Flux.Machine.UnloadAll();");
RunScriptWithOutput("Flux.Machine.Reload(120057); var result = \"done\";");
RunScript("Flux.BToolLibrary.Unload(1);");
RunScriptWithOutput("Flux.BToolLists.Flush(); var result = \"done\";");
RunScript("Flux.BTLIndex.Flush(); Flux.Machine.UnloadAll();");

View/Mode Context Commands

Switch active skin or simulation operation before checks.

RunScript("Flux.PartEditor.Current.Skin = Flux.EPartView.Model");
RunScript("Flux.PartEditor.Current.Part.BendTech.SimOp = Flux.PartEditor.Current.Part.BendTech.Ops[1];");
RunScriptWithOutput("Flux.PartEditor.Current.Part.DoFoldTo3D(); Flux.PartEditor.Current.Part.DoSwitchToBending(Flux.EDoFlags.Default, Flux.BendMachine.Get(120057)); Flux.PartEditor.Current.Skin = Flux.EPartView.BendCAM; var result = \"done\";");

Feature/Test Flag Commands

Temporary toggles used in targeted behavior tests.

RunScript("Flux.FX.DeveloperMC = false;");
RunScript("Flux.FX.Testing = true;");
RunScript("Flux.FX.Testing = false;");
RunScriptWithOutput("Flux.Experimental.MultiGripperMS = true; Flux.Experimental.Save(); Flux.BCupGrip.Flush(); var result = \"done\";");

Output/Export/Save Commands

Used to emit reports/config files and diagnostics.

RunScript("var part = Flux.PartEditor.Current.Part; var outfile = @\"<temp-path>\" + part.Info.RootFileName.Split('\\').Last(); Flux.ProgOutput.GenBendReport(part, -1, outfile, Flux.Sheaf.ERepFormat.HTML);");
RunScript("Flux.PartEditor.Current.Part.SaveFX(@\"<temp-path>temp.fx\");");
RunScript("Flux.PartEditor.Current.Part.BendTech.Setups[0].Save(@\"<temp-path>temp.bsetup\");");
RunScriptWithOutput("Flux.PartEditor.Current.Part.BendTech.BMachine.ExportConfig(@\"<temp-path>C149235.fxmcconfig\"); var result = \"done\";");
RunScriptWithOutput("Flux.MConsole.DumpHistory(@\"<temp-path>temp.txt\"); var result = \"done\";");

Query-For-Assertion Commands

Common assertion pattern: compute a value and assign to result.

RunScriptWithOutput("var result = Flux.PartEditor.Current.Part.BendTech.Ops[0].State.ToString();");
RunScriptWithOutput("var result = Flux.PartEditor.Current.Part.BendTech.Cell.Pickup.CState.ToString();");
RunScriptWithOutput("var result = (Flux.PartEditor.Current.Part.BendTech.Ops[0].Deduction = Flux.PartEditor.Current.Part.BendTech.Ops[2].Deduction).ToString();");

Select Bend Objects

Use selection commands to open matching globs and edit properties.

RunScript("Flux.Hub.SetSelection(Flux.PartEditor.Current.Part.BendTech.Ops[0], Flux.EModifiers.None);");
RunScript("Flux.Hub.SetSelection(Flux.PartEditor.Current.Part.BendTech.Ops[0].Setup.Mounts.First(a=>a.IsUpper), Flux.EModifiers.None);");
RunScript("Flux.Hub.SetSelection(Flux.PartEditor.Current.Part.BendTech.Cell.Deposits[0], Flux.EModifiers.None)");

Load Part and Switch to Bending

Used repeatedly for script-driven setup before assertions.

var commands = new List<string> {
  "var part = Flux.FX.LoadPart(@\"<part-path>\");",
  "if (!part.Info.IsSrc3D) part.DoFoldTo3D();",
  "part.DoSwitchToBending(Flux.EDoFlags.Default, Flux.BendMachine.Get(\"120057\"));",
  "Flux.PartEditor.Current.Skin = Flux.EPartView.BendCAM;"
};
RunScript(commands);

Read Command Output for Assertions

Set result in script and validate with RunScriptWithOutput.

var res = RunScriptWithOutput(
  "var result = (Flux.PartEditor.Current.Part.BendTech.Ops[0].Deduction = " +
  "Flux.PartEditor.Current.Part.BendTech.Ops[2].Deduction).ToString ();"
);
Assert.AreEqual(res, "True");

Configure Machine Output Behavior

Adjust destination and output formats before bend code/report generation.

var commands = new List<string>();
commands.Add("var mc = Flux.BendMachine.Get(120057);");
commands.Add("mc.Settings.Outputs.BendRepFormat = Flux.Sheaf.ERepFormat.PDF;");
commands.Add("mc.Settings.Outputs.BendRepAttachToNC = true;");
commands.Add("mc.Settings.Outputs.BendCodeDestination = @\"<temp-path>\";");
RunScript(commands);

Generate NC and Reports

Used for naming/output validation scenarios.

RunScript("Flux.ProgOutput.GenBendCode(part, @\"<out>.dlc\");");
RunScript("Flux.ProgOutput.GenBendReport(part, -1, @\"<out>\", Flux.Sheaf.ERepFormat.HTML);");

Library and Machine Refresh Commands

Stabilize state after catalog/tool changes.

RunScript("Flux.BToolLibrary.Unload(1);");
RunScript("Flux.BToolLists.Flush(); var result = \"done\";");
RunScript("Flux.BTLIndex.Flush(); var result = \"done\";");
RunScript("Flux.Machine.Reload(120057); var result = \"done\";");
RunScript("Flux.Machine.UnloadAll();");

Toggle Global/Test Flags

Temporary flags used in targeted behavior checks.

RunScript("Flux.FX.DeveloperMC = false;");
RunScript("Flux.FX.Testing = true;");
RunScript("Flux.FX.Testing = false;");

Query Bend-Tech Geometry/State

Typical query style: derive a value, assign to result, then assert.

var commands = new List<string>();
commands.Add("var op = Flux.PartEditor.Current.Part.BendTech.Ops[0];");
commands.Add("var result = op.Setup.Mounts.First(a=>a.Tool is Flux.BPunch).ToString();");
var outText = RunScriptWithOutput(commands);

Contents

  • Selection Commands
  • Machine/Tool Cache Reset Commands
  • View/Mode Context Commands
  • Feature/Test Flag Commands
  • Output/Export/Save Commands
  • Query-For-Assertion Commands
  • Select Bend Objects
  • Load Part and Switch to Bending
  • Read Command Output for Assertions
  • Configure Machine Output Behavior
  • Generate NC and Reports
  • Library and Machine Refresh Commands
  • Toggle Global/Test Flags
  • Query Bend-Tech Geometry/State
Command Cookbook BendTooling.cs Test Inventory

      Copyright © 2025 TRUMPF Metamation. All rights reserved.

    Compiled by Bento