question

Matthieu M avatar image
0 Likes"
Matthieu M asked Phil BoBo edited

Export treenodes (objects, lists, processflows, ...) in module

Hello,

As discussed in this thread, we are trying to save all our custom treenodes in a module.
There's a few reasons for this choice: Libraries are stored as hexadecimal, are not loaded at FlexSim startup. And by the way, we already have a module in which we have some C++ code.

So, we are trying to store objects, processflows and lists in this module.
As @phil.bobo explained yesterday, it is quiet easy to put objects.

I tried the same with a processflow (the "AGV elevator" just to give a try)

  • I copied its tree in "MAIN/project/library/FSProccessFlows/"
  • I created a new node in "VIEW:/standardviews/modelingutilities/LibraryIconGrid/GroupIconGrid>variables/visibilityLists/base/list" pointing on "MAIN:/project/library/FSProccessFlows"

At this stage, I expect to find a "FSProcessFlows" category in the sidebar which contains a processflow.
Instead, the category is actually empty and an unexpected one appears.

This new category called "Process Flow" and contains "AGV Elevator" which looks like this.

Finally, what we need is an easy and reproducible procedure to export all our objects of any kind (I will not be the only one to work on this project in a near future).
What I actually miss, with modules instead of libraries, is that attached processflows are exported with objects on which they are attached.
Is there a way to do this with the module ?
And for lists ?
Is there another object type I didn't mentionned that will be tricky to save in module ?

Thank you in advance !


PS: sorry for my bad english :sigh:

FlexSim 19.0.2
modules
5 |100000

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

1 Answer

Phil BoBo avatar image
1 Like"
Phil BoBo answered Phil BoBo edited

Your understanding of modules vs user libraries seems to be causing you confusion.

User libraries are designed for modelers to build reusable objects.

Modules are designed for advanced users and developers to customize the software directly. ProcessFlow, AGV, Conveyor, and AStar are all modules. Modules give you the ultimate flexibility to add or change functionality in the application. You can completely change the program or add entirely new features.

The documentation for modules is separate from the User Manual. The methodology of thinking about module development and the additional understanding of FlexSim's tree structure and data structures is documented in the Module SDK.


> Libraries are stored as hexadecimal, are not loaded at FlexSim startup.

I don't understand what you mean by "stored as hexadecimal." Any tree nodes can be saved to a file as binary or ascii and loaded as either format. Whether that tree structure is a user library, model, module, or any other section of the tree, it can be saved in either format. Typically, the ascii format (xml) is represented by the fsx extension and the binary format is represented by a description extension, such as t, fsm, fsl, fsv, fsp, etc.

User Libraries can also be loaded on startup by adding them into the list of "User Libraries to Open on Startup" in File > Global Preferences > Libraries.


> I tried the same with a processflow (the "AGV elevator" just to give a try)

* I copied its tree in "MAIN/project/library/FSProccessFlows/"

I don't understand what you mean by these statements. You copied what nodes from where to where? What is "its tree"?

Do you mean you added an instance of that template to your model and then copied the instance from MODEL:/Tools/ProcessFlow/AGV Elevator to MAIN:/project/library/FSProcessFlows/AGV Elevator?

If that's the case, then you need to give that object a "picture" attribute if you want it to appear in the Library icon grid as a drag-able icon:

The AGV Elevator process flow isn't shown in the library. It is in the list of process flow templates on the main toolbar and in the Toolbox view. You could also add your own process flow templates in the same way using your module. That's what the AGV module is doing.

Alternatively, you could add an instance of the template and point the icon grid at it so that you can add a copy of that instance via drag-drop, as shown in the image above. This is how process flows added to user libraries work.

> This new category called "Process Flow" and contains "AGV Elevator" which looks like this

That's showing an AGV Elevator process flow that in your model. That appears when you add an AGV Elevator template to a model. When you drag that into your model, it creates an instance of the Elevator object and links it to the AGV Elevator process flow in your model. That doesn't have to do with what your module is doing.

You can read the Custom Libraries section of the User Manual for an explanation of how those nodes work.


> Finally, what we need is an easy and reproducible procedure to export all our objects of any kind (I will not be the only one to work on this project in a near future).
What I actually miss, with modules instead of libraries, is that attached processflows are exported with objects on which they are attached.

While you could directly add your objects to the main and view trees, another option that might be easier for you would be to simply create your user library as normal and then add the user library node as an addition in your module. That way, you are using the module system to simply add a new user library and you can use the user library features that you understand better.


> Is there a way to do this with the module ?

And for lists ?

Is there another object type I didn't mentionned that will be tricky to save in module ?

You can do anything with modules, but it requires adding or replacing nodes throughout the main and view trees. The feature "attached processflows are exported with objects on which they are attached" is actually just code that is added by the ProcessFlow module. Your module could similarly add functionality to the software. You need to think of it in terms of module development, not simply "saving objects in modules."


picture-attribute.png (133.5 KiB)
5 |100000

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