Cancel
Showing results for 
Search instead for 
Did you mean: 

Line: editing the segmente table size

Valued Contributor
Valued Contributor

Hi,

 

im not sure how to edit the segment table in PlantSim. I need to do this in a method.

Im writing with for eg.

.Models.Frame.Line.CornerPoints.writeRow(1,3,820,240,20,-1.5707963267949,140);

but I need to increase the dimension for more entry's. How do i do this ?

.Models.Frame.Line.CornerPoints.YDim := 5;

doesn't work. (Can not assign a value to the expression on the left side of the assignment)

How do i do this ?

6 REPLIES

Re: Line: editing the segmente table size

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you cannot set yDim, you need to set maxYDim. For changing the segments table, follow the help for segmentsTable:

 

is
t:table;
do
t:=line.segmentsTable;
t.maxYDim:=t.yDim+1;
--write your data

--re-assign the segments table
line.segmentsTable:=t;



end;

 

 

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

Re: Line: editing the segmente table size

Valued Contributor
Valued Contributor

is there a possibility to edit the table directly like


    .Models.Frame.Line.segmentsTable.maxYDim := 4;
    .Models.Frame.Line.segmentsTable.writeRow(1,3,840,220,20,-1.5707963267949,120);
    print .Models.Frame.Line.segmentsTable.maxYDim;

that would be easier for my program and thx for your answer Smiley Happy

Re: Line: editing the segmente table size

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Readock,

 

no, this is not possible.

 

If you change the segments table row by row it you might have inconsistent intermediate data if you have curves. To avoid this, the table can only be assigned as a whole.

 

Regards,

Ralf

Regards,

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

Re: Line: editing the segmente table size

Valued Contributor
Valued Contributor

the problem is tht i communicate with c# over dde with PlantSimulation and need to change the segment table.I can send commands to Plant Sim (under 255 charackters). So i have a method

 

exectueCommand("print \"hello world!\";");

and in PLant Simulation there will be executed

is do print "hello world!"; end;

how can i change the contend with this ?

Re: Line: editing the segmente table size

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you could create an internal method for the line (e.g. <line>.appendPoint(real[])) and encapsulate the most of the programming in this method (get table, maxYDim++, write row, set table). The values you can pass as an array. Than you need only one line to add your point:

 

line.appendPoint(makeArray(1,3,840​,220,20,-1.5707963267949,120))

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

Re: Line: editing the segmente table size

Valued Contributor
Valued Contributor

ok thx for u help i did it now with execute and works well

execute("is t:table; do t:=line.segmentsTable;t.maxYDim :=3;t.writeRow(1,3,840,220,20,-1.5707963267949,120); line.segmentsTable:=t;end;");