ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
|
Downloads |
Gripes and Goodies Software problems and suggestions |
#1
|
||||
|
||||
The nodes in active view tree don't have unique names.
Hi Guys,
I was not sure if I should put my issue right away into the development plan, so I opened this thread to discuss about it. I have quite some problems with the active views in the view tree. Sometimes I need to get access to a specific view (View window, Global Table, GUI, etc.) because I like to manipulate something. But because on one hand all ortho views are called ‘ortho’ it is not easy to identify the right one. Same with persp by the way. On the other hand a Global Table might have the name GlobalTable Parameters119356104, but if I open it the next time it might be GlobalTable Parameters119359096. So how can I refer to the one I want? I know, that I can search through the views to find the first or the last ortho, but still I do not know which one is the right one I was looking for. I am not sure what might be a good solution for this and this is why I opened this thread. My first idea would be that the ortho should be called by the windowtitle (Standard: Orthographic View - 1 - model). So the user can change the title and can refer by name, if this is possible during open the view. For the GlobalTable I would use a name like GlobalTableTableName (GlobalTableMyParameters). I am not sure what to do with things like User Commands (How much sense does it make to have it twice open?) or with other windows. I hope you got the issue I have and I am pretty sure that you guys will find a good solution for this. Or there is already one and I just did not know. Take care tom the (A)tom P.S.: I also did not find a way how I could manipulate the column size of a Global Table if I like to have different width for each column. Does not matter if the Global Table is open (active) or closed (not active). Am I right, that the column width is just one main parameter for all columns of this table? I know that if I put the table in a GUI I can manipulate the width with the node cellwidth, but what if I do not want to use a GUI?
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#2
|
||||
|
||||
Okay, my P.S. issue I can now answer by myself .
It the same way as it can be done in the GUI. Just put under the node cellwidth some additional nodes, make the nodes number nodes and put a value into it. The value is the width of the cell. The first node is for the first column, the second for the second, and so on. I have no idea why I have overseen this the first time, because I was searching for it. Maybe I confused myself by all the posts I posted today .
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#3
|
||||
|
||||
Tom,
A discussion regarding the management of active windows in Flexsim comes up a lot around here. We realize it can be a challenge to manage all the windows available to you in Flexsim. In the next major release we hope to redesign the windowing interface to be more windows-like, more like a tabbed interface similar to Visual Studio. Anthony has did some experimenting with this a couple months back and had some real success. I just added a request item (ID# 413) to the Flexsim future development list regarding this point. Please feel free to add comments to the item regarding specific interface improvements you desire as part of this initiative. |
#4
|
|||
|
|||
I recently desired to obtain a reference to the highlighted object in the most active view window FROM another object's GUI. In the end I made an assumption that the user was working in the last model view window that was open previous to the object GUI itself. (not the greatest assumption to make)
Because the orthographic and perspective views are renamed, I used a comparetext for "ortho" or "persp". However, I understand that that this would not work if I had of needed a reference to a different type of window like Tom. This is the code in the OnPress of the button in the object's GUI. Is there a better way? setcurrent(prev(ownerview(c))); while(objectexists(current) && comparetext(getname(current),"Main Panel")==0) { if(comparetext(getname(current),"ortho") || comparetext(getname(current),"persp")) { setitem(selectedobject(current)); //hopefully another flowitem in the model setcurrent(rank(node("@>objectfocus+",c),2)); //target item if(objectexists(item) && comparetext(getname(node(">1",item)),"itemtype") && item!=current) //only if it is a flowitem { nodefunction(node("@>objectfocus+>labels/targeton/matchobjects",c), current, item); //my secret node function } repaintall(); return 0; } setcurrent(prev(current));} |
#5
|
||||
|
||||
Hi Tom and Kris,
If you want to get a specific view under the active view, I can think of two ways. The first way is to comprare the window title with your specific window title. The code would be something like this: Code:
treenode activeViews = node("/active",views()); for(int i=1;i<=content(activeViews);i++){ string winTitle=getviewtext(rank(activeViews,i)); if(stringsearch(winTitle,"Orthographic View - 1")!=-1){ pt("Found window ");pt(winTitle);pr(); // Do whatever you want here } } Code:
node("/active/ortho1",views()) Best wishes, Alan |
The Following User Says Thank You to AlanZhang For This Useful Post: | ||
Efrain Marchena (06-05-2012) |
#6
|
|||
|
|||
How can I reffer a command to a view in a active GUI?
Hi,
I created a videowall in the GUI with 5 views (called GUI 1) , respectively: perspective 166 ... perspective 170 In the tree edit window: MAIN -> project-> events -> OnRunStart. I startup my created GUI 1, with this code: string viewpath = "MAIN:/project/model/Tools/GUIs/GUI 1"; treenode viewnode = node(viewpath); set(spatialx(viewnode),0); set(spatialy(viewnode),100); //set(spatialsx(viewnode),400); //set(spatialsy(viewnode),400); //set(viewpointx(viewnode),-15); //set(viewpointy(viewnode),5); //set(viewpointz(viewnode),0); //set(viewpointrx(viewnode),315); //set(viewpointry(viewnode),0); //set(viewpointrz(viewnode),45); //set(viewmagnification(viewnode),2); //set(viewfield(viewnode),90); //set(windowtitle(viewnode),2); createview(viewpath, 0,0); During the model run I want to change the views of the different perspectives on my GUI 1 (videowall). What path do I have to use to get in control of these perspectives in the active GUI 1? I tried everything that I could find on this forum, but nothing has worked. Please help me,... kind regards, Koen van Thiel |
#7
|
|||
|
|||
When you create the views, store pointers to them in global variables or a treenodearray global variable which can store all 5.
These days createview may return the pointer - if not just find the last gui in the list of active views each time you create one. |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Jörg Vogel (01-18-2013) |
Thread | Thread Starter | Forum | Replies | Last Post |
Access to the tree variables | Iulian Marin Ion | Q&A | 2 | 02-06-2008 09:15 AM |