Cancel
Showing results for 
Search instead for 
Did you mean: 

Access to all objects by Simtalk

Creator
Creator

Hello community,

 

How can i access to all objects in my simulation modell by SimTalk?

I am searching for something like:

 

For all objects in model

    If object = parallelproc then

        xdim := 10

    End;

End;

 

In C# there is something like

 

foreach (Control c in this.Controls)

{

   if (c is Button)

   {

       //Code

   }

}

 

Is there a possability in SimTalk?

 

Thanks and Greetings

1 REPLY

Re: Access to all objects by Simtalk

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

try something like that:

 

for i:= 1 to root.numNodes loop
  if root.node(i).class.name="ParallelProc" then
    --do something
  end

next
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net