Can anyone tell me if there is a function in SimTalk to get a list of all the contents included in a frame other than using a for loop and the attributes Node(i) and NumNodes ?
The idea would be to have a function which can generate something similar to the contentlist attribute of some objects. Thus I could sort the table and filter it without having to check all the nodes of the frame.
Thank you in advance
Solved! Go to Solution.
You can create at the start the list you want, or if you prefer using a button.
for local i := 1 to current.NumNodes loop
Table[1,Table.Ydim+1] := current.node(i);
With the following method you can implement the feature in a reusable way:
param frame:object -> list var ContentsList:list[object] ContentsList.create for var i := 1 to frame.numNodes ContentsList.append(frame.Node(i)) next return ContentsList
It might make sense to implement this as a method of the frame. The problem is always that the more methods each objects has the more complex is its interface.
We are currently developing a model which continously creates and deletes objects and, since the total number of objects is very large, I wanted to reduce computering time whenever I need to check them.
@simulator I thought about using them, but the frame's method pasteClipboard actually paste all the selected objects before writing them into the table. So, every time I wanted to use these functions all the objects would become duplicated.