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 |
#1
|
||||
|
||||
Parent and Child Objects
All,
I am contemplating the creation of a parent child relationship with objects and I wanted to get your feed back first. The idea would be that you could toggle an object to be the child of another object in the model of the same class. The child object would then be updated with all of the variables and visual attributes (- location) of the parent object at certain times. Those times could be OnReset, User Specified, On Flexscript Build, etc. I think that this would be a great addition as it would reduce the amount of copying variables and labels that happens when building a model. I want to know what you think and how you feel that it should be implemented. What parameters would be copied, if labels should be included, if visuals should be included, etc. Thanks, Brandon
__________________
thats not normal. |
#2
|
|||
|
|||
If I understand you correctly, if you have 100 identical objects in a model, would this prevent you from having to make the same change 100 times? Maybe this could work kind of like the groups, except you specify the parent of a group, then push a button to copy your updates to all the other members of the group. It could be done by copying stuff from the highlighted to the selected objects, but it might be tricky to select all the objects to copy to without forgetting one or two.
|
#3
|
||||
|
||||
Alex,
Currently you have to select all the objects in the model that you want to copy to and select the copy from highlighted button to copy variables, shapes, or labels from one object to many others. The idea of parent and child objects would be that the child object would be toggled as a child of the parent once and then would be updated every time the parent was changed. Effectively making it so that you never had to apply the changes manually again. I think that it would be effective to have the parameters page of a child open up to a GUI that told you that it was a child and then offered the option of going to the parent or removing the parent/child relationship and opening up the normal parameters GUI for the object. Brandon
__________________
thats not normal. |
#4
|
|||
|
|||
Brandon,
I think this would be a useful feature. I've done models where I've developed an object and subsequently made many copies of that object for the model. As model development progressed I've had to go back and change the functionality of the base object and its copies by either selecting and copying (and hoping I updated all the copies) or by writing a user function that deleted all copies and than made new copies of the modified base object. Both ways are a bother. In those cases, I copied all variables, all labels, size, and Visual and Shape Factors. It would be good if there were check boxes on the child to specify which of those should be copied. Danny |
The Following User Says Thank You to Danny Pavan For This Useful Post: | ||
Brandon Peterson (08-11-2008) |
#5
|
||||
|
||||
I agree that it is a good idea to have inheritance in Flexsim. I build already some hierarchical models where I have the same structure in Visual Tools and it always took some time to copy modified code to all the objects, even if I did it by code. So I like the idea and would appreciate to have it.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
The Following User Says Thank You to Tom David For This Useful Post: | ||
Brandon Peterson (08-12-2008) |
#6
|
|||
|
|||
I would applaud (any) enhanced inheritance. I think it would have made our lives easier when updating models from our custom libraries.
But I am really interested in how it is used. Normally you want to create the relationship through a user library as I think it could get messy if you hvae parent-child relations within the model level. But that would mean that we always need to load the userlibrary to get the inheritance working? So I am not completely convinced at his point..... Regards, DJ |
The Following User Says Thank You to Dirk-Jan For This Useful Post: | ||
Brandon Peterson (08-13-2008) |
#7
|
||||
|
||||
I agree with everyone that this would be a very cool feature, and although I think Brandon would do a good implementation through Flexsim's content, I think a truly great implementation would require some engine support. At the same time, like DJ I have some doubts, or at least I think there are some hurdles to overcome, in regards to the implementation. For example what happens if the parent object is not saved in the same file as the child, in the case of a user-library-to-model parent-child relationship. Also, do we allow multiple levels of inheritance, where a given child can have a parent and a grandparent, etc. The other thing that is going to be tricky is allowing the user to visualize/modify these relationships, because I can see how a user could easily get very mixed up as to who is inheriting from whom, and when he modifies one object, and all of a sudden lots of other objects have been modified, how does Flexsim convey that information to the user?
|
The Following User Says Thank You to Anthony Johnson For This Useful Post: | ||
Brandon Peterson (08-13-2008) |
#8
|
||||
|
||||
All,
My feeling on this is that the Parent / Child relationship would only be in the current model and would not include the user library (unless you could get the user library to automtically load with a model). This way you don't have to worry about changes made outside of the model. Unless anyone sees things differently, I would also limit the inheritance to the basic parent and child, no grandparents, uncles, cousins, half-brothers, or any other type of relationships. Even with these simplifying assumptions there is still a lot of complexity to the implementation and a lot of functionality that could be included. I have a trip next week and might find some time to do an example, so the more people that speak there mind now the better. Brandon
__________________
thats not normal. |
#9
|
||||
|
||||
This topic was raised once before on the community site, and generated a request for the future development list. I still believe it would be a nice elegant implementation with very little difficulty in development (as verified by Eamonn Lavery). Here's the related post.
|
The Following User Says Thank You to Cliff King For This Useful Post: | ||
Brandon Peterson (10-01-2009) |
#10
|
||||
|
||||
Hello
Hello
I have nodes in my model with different properties ( coordinates x and y ) which i am reading from a database, and i would like to replicate them for all the coordinates. Is there any way possible. Each node is like a stop and i have the list of stops as coordinates in a data base. I would like flexsim to read this database ( which i have sorted ) and replicate all the nodes to their respective coordinates. Any help please ?? |