Cancel
Showing results for 
Search instead for 
Did you mean: 

06=Method attributes - How do you access them from another method ?

Genius
Genius

I have a Method associated with managing the WIP storage of a process WS4,  "WS4_Meth_Storage".

How do I access its Label, XPos and YPos attributes from within another method?

 

The syntax
    "//WS4_Meth_Storage : "      +     to_str(  WS4_Meth_Storage.Label)


fails as the debugger reports

    Cannot evaluate expression      for the term  WS4_Meth_Storage.Label

 

I can access and change the Label, and both *Pos attributes, from the attribute and methods explorer in the method's right click menu.

 

Also I can access and also change these three attrributes for any frame and processing objects using SimTalk within a method.

 

I need the Method to move with its Processing Object, under control of a method that re-arranges model elements at different locations on the model mimic, and it would be a huge pity if this fails because the Method cannot support this functionality.

I suppose a workaround could be to locate it in a frame, but that seems a huge pity given it should behave like the other model objects.

Thanks for any feedback.

 

____________________________________________
PlantSim Ver 14.1.0.1294   &  Windows 7 Ent. SP1

~~~~  1st post in thread  ~~~~

2 REPLIES 2

Re: Method attributes - How do you access them from another method ?

Phenom
Phenom

try  &method.label

Highlighted

Re: Method attributes - How do you access them from another method ?

Genius
Genius

Thanks a lot , that is exactly what I needed. Would have been hard to find myself in the help file.


So to summarise nicely, here is the actual implementation where the specific method's x position is read and logged, and thereafter a new position read from a table file and it is updated.


// Log original position
DBG_Locns.writeRow(2, iRow,
"&WS4_Meth_Storage.XPos := " + to_str( &WS4_Meth_Storage.XPos) )

// Update position for revised layout
&WS4_Meth_Storage.XPos := str_to_num( BFX_Locns[2, iRow+iRow_IN])


It makes sense reading about use of & in the online help file, without this address-of operator, the method would be called.