Unable to create windows.fsx file following documentation

Unable to create windows.fsx file following documentation

benjoaquin_gouverneur
Not applicable
163 Views
7 Replies
Message 1 of 8

Unable to create windows.fsx file following documentation

benjoaquin_gouverneur
Not applicable

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.

Accepted solutions (1)
164 Views
7 Replies
Replies (7)
Message 2 of 8

sam_stubbsYXX86
Community Manager
Community Manager
Accepted solution

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.)

Message 3 of 8

benjoaquin_gouverneur
Not applicable

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
Message 4 of 8

philboboADSK
Autodesk
Autodesk

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.



Phil BoBo
Sr. Manager, Software Development
Message 5 of 8

benjoaquin_gouverneur
Not applicable

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
Message 6 of 8

philboboADSK
Autodesk
Autodesk

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.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 7 of 8

benjoaquin_gouverneur
Not applicable

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
Message 8 of 8

philboboADSK
Autodesk
Autodesk

Map your ProcessFlow objects to different files similar to how you did with your Workspace node.

You can also add triggers to your model that fire before and after the save operation:

2605-onmodelsave.png

You can set things that change back to a default value in the OnModelPreSave so that they don't muddy up your repository. Then you can set them back to their previous values in the OnModelSave. (You would need to save their values somewhere outside of the model treenode if you want to set them back in the OnModelSave.)



Phil BoBo
Sr. Manager, Software Development
0 Likes