AddShapeByCode

<< Click to Display Table of Contents >>

Navigation:  TMyCAD > Methods >

AddShapeByCode

 

function AddShapeByCode( Owner:TComponent;ShapeStyle:TDrawTool; ShapeName:string;ThePoints: array of TMyPoint;TheAngle:Extended=0;OnlyForText:String=''): integer;

 

 

Description:

 

 Add shape by code, it is useful for automatic drawing . if you want add a image ,Please use     AddImageShapeByCode.

 

Return Value:

   0: Ok

  -1: incorrect points count

 

 

Parameter:

    Owner:instance of TMyCAD

   ShapeStyle : Please see TDrawTool

   ShapeName:  shape's name

   ThePoints:  Points array

   TheAngle: The Angle of this new shape

  OnlyForText: it is for TMyText shape only

 

 

Example:

 

 MyCAD1.AddShapeByCode(MyCAD1,spEllipse, 'EllipseShape',[MyPoint(231, 211), MyPoint(340,211),MyPoint(340, 350),MyPoint(231,350)]);

end;

 

See also:

AddImageShapeByCode

AddCmbShapeByCode

OnShapeAdded