question

martin.j avatar image
0 Likes"
martin.j asked Matt Long commented

Creation of custom modules in FS 17.1.2

Hi,

I have been looking at a video from one of the distributer trainings about the creation of custom Flexsim modules in the Flexsim tree rather than making my own C++ dlls. Unfortunately I cant seem to get it to work. When I run the applicationcommand("savedefaultviewproject"); it asks me if I want to save the view and collapse and close all trees, but it doesn't create those two essential files in my modules folder that I expected and my new module does not show up in the modules menu on right click.

I will reiterate the steps I have taken and perhaps you can tell me where I went wrong:

1 I reinstalled Flexsim 17.1.2 to a custom location to have total read and write access.

2 I added an empty 'NewModule' folder to the 'modules' folder of the new installation.

3 I then opened Flexsim and in the 'View/environment' tree I created the dev =1 node and successfully activated dev mode.

4 I then added a the new subnode 'NewModule' to the 'View/modules' tree where the other installed modules are listed. Into the 'NewModule' node I added another subnode called 'Installdata'.

5 I now ran the applicationcommand("savedefaultviewproject"); and selected 'yes' to the two popups that asked me if I want to save the view project and collapse all trees and views. Flexsim then worked for a few seconds and returned to normal.

6 I checked the 'NewModule' folder under the installation to see of the two module files had been created, but it was still empty, and when I right click a node and go to the modules menu selection I can only see the installed modules and not my 'NewModule'.

Does this approach still work in Flexsim 17.1.2, and if so can you spot what I have been doing wrong?

FlexSim 17.1.2
custom codemodulescustom
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

·
Matthew Gillespie avatar image
4 Likes"
Matthew Gillespie answered Matt Long commented

You need to do step 4 in the main tree, not the view tree.

Have you taken a look at our ModuleSDK? You'll find a bunch of resources, documentation, and examples to help you develop a module.

Take a look at the QuickStart.html and ModuleDevelopment.html files in the Documentation folder.

· 7
5 |100000

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

martin.j avatar image martin.j commented ·

I have now tried following the ModuleSDK, but I didn't get any further.

I created the needed nodes in the main tree instead, but now when I 'savedefaultviewproject' I get the following error and Flexsim locks up:

exception: Exception caught in globalcommand_savebyname()
exception: FlexScript exception: VIEW:/standardviews/savedefaultviewproject

Also Next time I open my development version of Flexsim this error pops up.

Fortunately its only the development copy that appears to be broken.

0 Likes 0 ·
moduleerror.png (5.2 KiB)
Matt Long avatar image Matt Long martin.j commented ·

Is your FlexSim directory in a place where you have write permissions? If you have it installed in the Programs directory you'll need to move (or create a copy) it into somewhere like your Documents directory.

0 Likes 0 ·
martin.j avatar image martin.j Matt Long commented ·

Ok I have done a bunch more testing on this topic:

If I use a copy of a Flexsim 17.0.3 or 17.1.2 for my Dev_Version the module creation fails - not in the same way but it fails. But using a copy of Flexsim 16.2.2 I managed to create a new module and the recuired *d.fsx and *.t files were created in the module folder.

I have now copied my new module into my Flexsim 17.1.2 Dev_Version and it works! But its still a bit annoying that I cant create modules in Flexsim 17.

1 Like 1 ·
Show more comments
Show more comments
martin.j avatar image martin.j martin.j commented ·
@Matt Long

But I am not really using the SDK files... I just read the instructions in the QuickStart.html that explains how to make modules in the Flexsim tree. Correct me if I am wrong, but the SDK is only needed to make custom coded modules in Visual C++ right? There is an option to make modules without using the actual SDK files?

0 Likes 0 ·
Matt Long avatar image Matt Long martin.j commented ·

Yes, if all you're doing is adding nodes to the Main or View tree you don't need the SDK files. I'm not sure what the issue could be. If you want to try and get together on a screen sharing meeting we may be able to figure out what's going on.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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