question

BenJoaquin Gouverneur avatar image
2 Likes"
BenJoaquin Gouverneur asked Phil BoBo edited

Unable to create windows.fsx file following documentation

Hey folks,

I'm trying to follow the instructions here for using FlexSim XML (.fsx format) to save a model. I've successfully used the "split-points" file map method but haven't been successful using the "single-node" to save off the "/Tools/active" node. I think that saving the attached .fsx model in FlexSim should create a new "windows.fsx" file but that isn't happening on my system. Can someone help me understand why this isn't working?

In trying to debug this I noticed that the "active" node doesn't appear to be a child of the "Tools" node so perhaps it isn't working since "/Tools/active" isn't a valid path. In fact, all of the objects in the "View" view under "Tree Navigation" don't seem to exist as children of the "Main" tree. Furthermore, I don't see any of those nodes in the model .fsx file which I expect to contain all of the details of the model. Does "active" and the other "View" objects exist in a tree separate from "Main"?

I talked with Sam at FlexSim today but we weren't able to readily identify or resolve the issue. I've attached the model.fsx, fileMap.ffm and distributedfiles folder I created while following the tutorial. creating-a-windows-fsx-file.zip

Thanks.

Choose One
xml
· 4
5 |100000

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

BenJoaquin Gouverneur avatar image BenJoaquin Gouverneur commented ·

possible-spatial-culprit.pngHey @Sam Stubbs and @phil.bobo,

So now that we fixed the path we are able to create the new file but it looks like the "Workspace" content that is being created in windows.fsx is duplicated and still resides in the model.fsx file.

Attached is an example with master and branch files. The only difference is that in the branch I resized the window and saved. Looks like it might be related to having a Process Flow in the model.

Thanks for your help.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ BenJoaquin Gouverneur commented ·

The nodes you are seeing aren't subnodes of the Workspace node. They are variables on the ProcessFlow object.

The ProcessFlow object in the tree stores information about the size of its window so that it can try to reposition and size it similarly when you close and reopen it.

This is all behaving as designed.

0 Likes 0 ·
BenJoaquin Gouverneur avatar image BenJoaquin Gouverneur Phil BoBo ♦♦ commented ·

Thanks @phil.bobo. That makes sense and I wasn't trying to suggest that it wasn't behaving as designed. It does however make version control on models with Process Flow a bit annoying since resizing windows causes mymodel.fsx to be modified with a window resize even if we've split the Workspace node to a separate file. It also appears that the changes to mymodel.fsx that come from resizing a window are duplicated in the windows.fsx file containing the Workspace node.

Since Process Flow is so awesome I anticipate nearly all of our models leveraging it going forward. Let me know if you have recommendations for how we reduce the noise on version changes to models using Process Flow.

Thanks.

0 Likes 0 ·
Show more comments

1 Answer

Sam Stubbs avatar image
3 Likes"
Sam Stubbs answered Phil BoBo commented

So after we spoke on the phone, we went through the documentation and realized the XML code given for the ffm file is out of date. The structure of the system has shifted, and "active" is no longer part of that structure, instead have it write to the "Workspace" path.

The updated code will look like this:

<?xml version="1.0" encoding="UTF-8"?>
<flexsim-file-map version="1">
	<map-node path="/Tools/Workspace" file="distributedfiles\windows.fsx" file-map-method="single-node"/>
</flexsim-file-map>

We will need to update this in the documentation.

(Also just as a note: When creating the ffm file, that Windows by default hides file extensions. So if you are making a file in Notepad, then it might append the .txt format on the end of your file. So just double check to make sure that the file format is in fact a .ffm file.)

· 2
5 |100000

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

BenJoaquin Gouverneur avatar image BenJoaquin Gouverneur commented ·

Sam Stubbs,

The concept in your code works but note that you have an errant backslash in there. The code that worked for me is:

<?xml version="1.0" encoding="UTF-8"?>
	<flexsim-file-map version="1">
		<map-node path="/Tools/Workspace" file="distributedfiles/windows.fsx" file-map-method="single-node"/>
	</flexsim-file-map>

I'm still a bit fuzzy on the tree structure. I see "Workspace" in a .fsx file but it isn't visible when navigating the tree in FlexSim. If you have feedback on that I think it would be useful for the community but if not I'll follow up more with you folks offline.

Thanks!

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ BenJoaquin Gouverneur commented ·

When you save the model, it saves the current view layout in the Tools folder in a node called Workspace. When you load the model, it sets the views based on what was in the Workspace node and then deletes it.

So you never actually see it in the tree while the model is open, but it is saved in the file when you save the model.

1 Like 1 ·