Articles


Set ShapeTool property as SpPolygon,then you can draw it by mouse.

Also,you can draw it by code.

Code example:

procedure TMainFrm.Button1Click(Sender: TObject); 
var 
  p: array of TmyPoint; 
begin 
  SetLength(P, 4); 
  P[0] := MyPoint(390, 11); 
  p[1] := MyPoint(380, 70); 
  p[2] := MyPoint(210, 10); 
  p[3] := MyPoint(110, 190); 
  if MyCAD1.GetShapeByName('PolygonShapeArray') = nil then 
    MyCAD1.AddShapeByCode(MyCAD1,spPolygon, 'PolygonShapeArray', p); 
  SetLength(P, 0); 
end;