Announcements

Announcement: We’re aware of an issue affecting starting a new topic from category pages and creating new blog posts. New topics can still be started directly from the relevant board. Learn more here.

Is there any code that can select/open a Global Table?

Is there any code that can select/open a Global Table?

manuel_s4
Not applicable
2,652 Views
14 Replies
Message 1 of 15

Is there any code that can select/open a Global Table?

manuel_s4
Not applicable

[ FlexSim 19.1.0 ]

I'm developing a GUI using the dashboard part, so I want to add a custom code that opens a Global table each time the user presses a button.

0 Likes
Accepted solutions (1)
2,653 Views
14 Replies
Replies (14)
Message 2 of 15

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution
applicationcommand("edittable", Model.find("MODEL:/Tools/GlobalTables/GlobalTable1"));


Matthew Gillespie
FlexSim Software Developer

Message 3 of 15

manuel_s4
Not applicable

As ALWAYS it worked. Thanks Matt!!

0 Likes
Message 4 of 15

manuel_s4
Not applicable

Another question Matt, is there a similar code to open the Time Tables view?

0 Likes
Message 5 of 15

Matthew_Gillespie
Autodesk
Autodesk
treenode timeTable = Model.find("Tools/TimeTables/TimeTable1");
createview("VIEW:/pages/tools/TimeTable Parameters", timeTable.getPath(), timeTable.getPath());


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 6 of 15

manuel_s4
Not applicable

Great! Thanks again Matt!

0 Likes
Message 7 of 15

tay_l
Not applicable

Hi Mr. Matthew, Im encountered error msg when using this code: applicationcommand("edittable", Table(""));

Flexscript Error VIEW:/active/GUI testing1054953478/button>OnPress line 1 The function Table is not recognized.

Why?

0 Likes
Message 8 of 15

Matthew_Gillespie
Autodesk
Autodesk

@Tay L I don't understand what you're trying to do. Table("") doesn't do anything. You have to put the name of the table you want in the Table() constructor. But you should really use my example above which works best.

applicationcommand("edittable", Model.find("MODEL:/Tools/GlobalTables/YOUR_TABLE_NAME_HERE"));


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 9 of 15

tay_l
Not applicable

Hi @Matthew Gillespie thanks for the quick response.


If I use the code below:

1633484222215.png


This is the error:

1633484239115.png



If use the code:

1633484265938.png


The table display NULL, and the error mesage belwo:


1633484312208.png


Thank you.


0 Likes
Message 10 of 15

Matthew_Gillespie
Autodesk
Autodesk
@Tay L What version of the software are you using? If you're using an older version you should replace Model.find with model().find


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 11 of 15

tay_l
Not applicable

Im using Flexsim 7.3. After i use model().find, the table shows NULL and error message :

"Flexscript Error VIEW:/active/GUI testing564263746/button>OnPress line 1 The method find is not recognized"


0 Likes
Message 12 of 15

mischa_spelt
Advisor
Advisor

In FlexSim 7.3 it's

node("MODEL:/Tools/...")

But why are you still using a version of over 7 years old?

0 Likes
Message 13 of 15

tay_l
Not applicable
Hi @Mischa Spelt, many thanks. We are using this version, for learning and familiarise the software functions.


Could you share what is the code for sorting and filtering the global table data? For example, I would like to use GUI to find a part name or part number in the Global table.

0 Likes
Message 14 of 15

Matthew_Gillespie
Autodesk
Autodesk

@Tay L Please post this as a new question and choose 7.3 in the software version dropdown.



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 15 of 15

tay_l
Not applicable
@Matthew Gillespie ok Thanks!
0 Likes