Cancel
Showing results for 
Search instead for 
Did you mean: 

is it possible to write all objects to a table

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Hello, 

 

Is it possible to write the names of all the objects, like conveyors, single procs etc to a table file. In a model there quite a large number of conveyors and hence to validate that the speeds and quantity are rightly defined looking for this option. 

 

Thanks in advance for the suggestions. 

 

Regards, 

 

Rohit

3 REPLIES

Re: is it possible to write all objects to a table

Siemens Phenom Siemens Phenom
Siemens Phenom

Hello Rohit,

 

Frame.numNodes gives you the number of objects in a frame. You then have to program a for loop over all nodes:

 

local numberOfNodes := frame.numNodes;

for local i := 1 to numberOfNodes loop

    local obj := fram,e.node(i);

    -- here add your code

next;

 

you can then check the internalClassName of obj to determine the type of the object. If the internalClassName="Line" the the object is a conveyor.

 

Regards

 

GG

Regards
GG

------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution

Re: is it possible to write all objects to a table

Siemens Phenom Siemens Phenom
Siemens Phenom

If you have a hierachical model with conveyors in sub-frames, you can check for internalClassName="Network" and call the Method recursively in this case:

 

 

(frame: object)
is
do
    for local i := 1 to frame.numNodes loop
        local obj := frame.node(i);
        inspect obj.internalClassName
        when "Line" then
            -- add your code here
        when "Network" then
            self.execute(obj)
        end;
    next;
end;

 

 

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: is it possible to write all objects to a table

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Thanks Michael and GG for the solution. It worked and saved a lot of time Smiley Happy