question

Serge A avatar image
0 Likes"
Serge A asked Logan Gold edited

Compare tree nodes saved in .t format

It would be convenient to be able to compare .t files semantically without loading them as nodes to flexsim environment. Being able to visualize the tree structure in any textual form and the contents of the text nodes containing the flexscript code would allow to use standard diff utilities. For this purpose the transformation from .t to plain text does not need to be lossless or bidirectional.

After the first look at the files it appears that the data block starting at the offset 0x0030 is scrambled/compressed, but no evident magic number is present. In the same time there are some plain-text HTML data.

Is the format documented somewhere or do the tools to deal with it outside of the Flexsim environment exist? What compression scheme is used?

Choose One
tree nodexmlfile format
5 |100000

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

Ben Wilson avatar image
2 Likes"
Ben Wilson answered Logan Gold edited

When you right-click a node or set of nodes and choose Node > Save Node As... you are presented with a save dialogue:

Under Save as type: you can specify to save to FlexSim's XML format instead of a binary .t file.

These plaintext XML files facilitate comparisons using diffing programs such as WinMerge, or for versioning systems such as SVN, Mercurial, or GitHub.

Model files and State files can also be saved to the FlexSim XML format.

You can read about FlexSim's XML format in the User Manual under Misc Concepts > FlexSim XML, or here online.


· 3
5 |100000

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

Serge A avatar image Serge A commented ·

Thank you for a quick response. Saving manually as XML does accomplish the task. Though as there are many .t files to be compared, I'd prefer to have a tool to convert them to .fsx automatically.

Is it possible to save nodes to FSX automatically without user intervention (non-interactively)? Sort of like `cmdsavetree()` command that saves binary files, but save .fsx instead. `savetree()` appears to support only interactive mode.

0 Likes 0 ·
Logan Gold avatar image Logan Gold ♦♦ Serge A commented ·

You can still use the cmdsavetree() command. For the second parameter, you can put .fsx as the file extension as part of the filename.

So modifying the example for cmdsavetree (which has a treenode being saved as mytree.t), you could do this:

cmdsavetree(node("MAIN:/project/library/1"),"c:\\mytree.fsx");

0 Likes 0 ·
Serge A avatar image Serge A Logan Gold ♦♦ commented ·

Thank you. cmdsavetree(..., "file.fsx") solves my problem. It would be nice to add this example to the built-in documentation of cmdsavetree.

0 Likes 0 ·
Steven Hamoen avatar image
2 Likes"
Steven Hamoen answered
@S. Astanin

Exactly for this purpose Flexsim has a xml structure. you can save everything (simple object or complete model ) as fsx file. The .fsx file is an xml structured file. Look for XML in your Flexsim helpfile and a lot of information will be available for you.

5 |100000

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